From c671ad034c3b8c79191129baf2ec12a1be589b2b Mon Sep 17 00:00:00 2001 From: Cizz22 Date: Wed, 1 Oct 2025 15:11:39 +0700 Subject: [PATCH] fix --- src/aeros_simulation/router.py | 4 ++-- src/aeros_simulation/service.py | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/aeros_simulation/router.py b/src/aeros_simulation/router.py index 0edfede..ec8af0c 100644 --- a/src/aeros_simulation/router.py +++ b/src/aeros_simulation/router.py @@ -48,10 +48,10 @@ active_simulations = {} @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.""" - results = await get_all(common) + results = await get_all(common, status) return { "data": results, diff --git a/src/aeros_simulation/service.py b/src/aeros_simulation/service.py index 3e383ad..b28c40c 100644 --- a/src/aeros_simulation/service.py +++ b/src/aeros_simulation/service.py @@ -37,8 +37,9 @@ active_simulations = {} # Get Data Service -async def get_all(common: CommonParameters): - query = select(AerosSimulation).where(AerosSimulation.status == "completed") +async def get_all(common: CommonParameters, status): + if status: + query = select(AerosSimulation).where(AerosSimulation.status == "completed") results = await search_filter_sort_paginate(model=query, **common)