From 82711639b24dc0fc8fa02c2323661cae0f6ce110 Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Thu, 27 Mar 2025 20:21:41 +0100 Subject: [PATCH] Update code in endpoints/peoples.delete.py --- endpoints/peoples.delete.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 endpoints/peoples.delete.py diff --git a/endpoints/peoples.delete.py b/endpoints/peoples.delete.py new file mode 100644 index 0000000..e258a8e --- /dev/null +++ b/endpoints/peoples.delete.py @@ -0,0 +1,18 @@ +# Entity: People + +from fastapi import APIRouter, Depends, HTTPException, status +from typing import List +from core.database import get_db +from sqlalchemy.orm import Session +from models.people import People +from schemas.people import PeopleSchema +from helpers.people_helpers import delete_people_below_50 + +router = APIRouter() + +@router.delete("/peoples", status_code=200) +async def delete_peoples_below_50_years_old( + db: Session = Depends(get_db) +): + delete_people_below_50(db) + return {"message": "People below 50 years old deleted successfully"} \ No newline at end of file