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