From 10a63f4b79889db00e75566086cb1176a2e17c98 Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Fri, 28 Mar 2025 01:07:34 +0000 Subject: [PATCH] Update code in endpoints/people.post.py --- endpoints/people.post.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 endpoints/people.post.py diff --git a/endpoints/people.post.py b/endpoints/people.post.py new file mode 100644 index 0000000..186ffff --- /dev/null +++ b/endpoints/people.post.py @@ -0,0 +1,17 @@ +# Entity: Person + +from fastapi import APIRouter, Depends, HTTPException, status +from sqlalchemy.orm import Session +from core.database import get_db +from models.person import Person +from schemas.person import PersonSchema, PersonCreate +from helpers.person_helpers import create_person + +router = APIRouter() + +@router.post("/people", status_code=201, response_model=PersonSchema) +async def create_new_person( + person: PersonCreate, + db: Session = Depends(get_db) +): + return create_person(db=db, person=person) \ No newline at end of file