Cizz22 3 months ago
parent def04120d5
commit c671ad034c

@ -48,10 +48,10 @@ active_simulations = {}
@router.get("", response_model=StandardResponse[SimulationPagination]) @router.get("", response_model=StandardResponse[SimulationPagination])
async def get_all_simulation(db_session: DbSession, common: CommonParameters): async def get_all_simulation(db_session: DbSession, common: CommonParameters, status: Optional(str) = Query(None)):
"""Get all simulation.""" """Get all simulation."""
results = await get_all(common) results = await get_all(common, status)
return { return {
"data": results, "data": results,

@ -37,8 +37,9 @@ active_simulations = {}
# Get Data Service # Get Data Service
async def get_all(common: CommonParameters): async def get_all(common: CommonParameters, status):
query = select(AerosSimulation).where(AerosSimulation.status == "completed") if status:
query = select(AerosSimulation).where(AerosSimulation.status == "completed")
results = await search_filter_sort_paginate(model=query, **common) results = await search_filter_sort_paginate(model=query, **common)

Loading…
Cancel
Save