fooder-api/fooder/view/meal.py

16 lines
378 B
Python
Raw Normal View History

2023-04-01 16:19:12 +02:00
from fastapi import APIRouter, Depends, Request
from ..model.meal import Meal, CreateMealPayload
from ..controller.meal import CreateMeal
router = APIRouter(tags=["meal"])
2023-04-01 20:23:04 +02:00
@router.post("", response_model=Meal)
2023-04-01 16:19:12 +02:00
async def create_meal(
request: Request,
data: CreateMealPayload,
contoller: CreateMeal = Depends(CreateMeal),
):
return await contoller.call(data)