add filters for all routes

This commit is contained in:
2026-02-15 01:09:36 +01:00
parent f440cef59e
commit a7b83da149
22 changed files with 184 additions and 82 deletions

View File

@@ -14,7 +14,12 @@ def get_products(
types: list[str] = Query([]),
productors: list[str] = Query([]),
):
return service.get_all(session, names, productors, types)
return service.get_all(
session,
names,
productors,
types,
)
@router.get('/{id}', response_model=models.ProductPublic)
def get_product(id: int, session: Session = Depends(get_session)):

View File

@@ -6,7 +6,6 @@ def get_all(
names: list[str],
productors: list[str],
types: list[str],
) -> list[models.ProductPublic]:
statement = select(models.Product)
if len(names) > 0: