Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions spoolman/api/v1/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from enum import Enum
from typing import Annotated

from fastapi import APIRouter, Depends, Response
from fastapi import APIRouter, Depends, Query, Response
from sqlalchemy.ext.asyncio import AsyncSession

from spoolman.database import filament, spool, vendor
Expand Down Expand Up @@ -34,8 +34,12 @@ async def export_spools(
*,
db: Annotated[AsyncSession, Depends(get_db_session)],
fmt: ExportFormat,
allow_archived: Annotated[
bool,
Query(description="Whether to include archived spools in the export."),
] = False,
) -> Response:
all_spools, _ = await spool.find(db=db)
all_spools, _ = await spool.find(db=db, allow_archived=allow_archived)
return await _export(all_spools, fmt)


Expand Down