feat: Update endpoint fruits
This commit is contained in:
parent
83243ce14d
commit
7b3934b43f
@ -13,13 +13,4 @@ def get_fruits(
|
|||||||
db: Session = Depends(get_db)
|
db: Session = Depends(get_db)
|
||||||
):
|
):
|
||||||
return get_all_fruits(db, order_by)
|
return get_all_fruits(db, order_by)
|
||||||
|
|
||||||
@router.get("/fruits/{fruit_id}", status_code=status.HTTP_200_OK, response_model=FruitSchema)
|
|
||||||
def get_fruit(
|
|
||||||
fruit_id: str,
|
|
||||||
db: Session = Depends(get_db)
|
|
||||||
):
|
|
||||||
fruit = get_fruit_by_id(db, fruit_id)
|
|
||||||
if not fruit:
|
|
||||||
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Fruit not found")
|
|
||||||
return fruit
|
|
Loading…
x
Reference in New Issue
Block a user