From 4d20babd38cc6559c8ee65faf4bddb4f04aa8bdd Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Fri, 28 Mar 2025 08:37:27 +0000 Subject: [PATCH] Add GET endpoint for menu --- endpoints/menu.get.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 endpoints/menu.get.py diff --git a/endpoints/menu.get.py b/endpoints/menu.get.py new file mode 100644 index 0000000..0a7067c --- /dev/null +++ b/endpoints/menu.get.py @@ -0,0 +1,18 @@ +# Entity: Meal + +from fastapi import APIRouter, Depends, status +from sqlalchemy.orm import Session +from typing import List +from core.database import get_db +from models.meal import Meal +from schemas.meal import MealSchema +from helpers.meal_helpers import get_all_meals + +router = APIRouter() + +@router.get("/menu", status_code=200, response_model=List[MealSchema]) +async def get_menu( + db: Session = Depends(get_db) +): + meals = get_all_meals(db) + return meals \ No newline at end of file