fooder-api/fooder/view/user.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.user import User, CreateUserPayload
from ..controller.user import CreateUser
router = APIRouter(tags=["user"])
2023-04-01 20:23:04 +02:00
@router.post("", response_model=User)
2023-04-01 16:19:12 +02:00
async def create_user(
request: Request,
data: CreateUserPayload,
contoller: CreateUser = Depends(CreateUser),
):
return await contoller.call(data)