diff --git a/spoolman/api/v1/export.py b/spoolman/api/v1/export.py index f94e4942b..488d2fd20 100644 --- a/spoolman/api/v1/export.py +++ b/spoolman/api/v1/export.py @@ -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 @@ -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)