add filters for all routes
This commit is contained in:
@@ -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)):
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user