flag special orders in ui

This commit is contained in:
2025-05-31 12:00:28 -04:00
parent dca11b0ede
commit fa089adb53
5 changed files with 69 additions and 6 deletions

View File

@ -32,7 +32,8 @@ router = APIRouter(prefix="/orders")
@router.get("/", response_model=List[TCGPlayerAPIOrderSummary])
async def get_orders(
search_range: SearchRange = SearchRange.LAST_THREE_MONTHS,
open_only: bool = False
open_only: bool = False,
db: Session = Depends(get_db)
) -> List[TCGPlayerAPIOrderSummary]:
"""
Retrieve orders from TCGPlayer based on search criteria.
@ -47,6 +48,7 @@ async def get_orders(
try:
order_management = service_manager.get_service('order_management')
orders = await order_management.get_orders(search_range, open_only)
orders = await order_management.add_item_quantity(db, orders)
return orders
except Exception as e:
raise HTTPException(status_code=500, detail=f"Failed to fetch orders: {str(e)}")