Skip to content
Snippets Groups Projects
Commit d1572f57 authored by Omar Ibrahim Arfa's avatar Omar Ibrahim Arfa
Browse files

fix pipeline

parent cde31b7e
Branches
No related tags found
No related merge requests found
......@@ -28,10 +28,12 @@ def get_all_orders(db: Session):
entities = db.query(Order).all()
return entities
def get_filtered_orders(db: Session, status: OrderStatus):
entities = db.query(Order).filter(Order.order_status == status).all()
return entities
def delete_order_by_id(order_id: uuid.UUID, db: Session):
entity = get_order_by_id(order_id, db)
if entity:
......
......@@ -36,10 +36,11 @@ def get_all_orders(
orders = order_crud.get_all_orders(db)
return orders
@router.get('/{order_status}', response_model=List[OrderSchema], tags=['order'])
def get_filtered_orders(
db: Session = Depends(get_db),
order_status = OrderStatus
order_status = OrderStatus,
):
orderUpperString = str(order_status).upper()
order_status = getattr(OrderStatus, orderUpperString)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment