Update code in endpoints/people.delete.py

This commit is contained in:
Backend IM Bot 2025-03-27 20:18:30 +01:00
parent b00b491059
commit ae6af1dc8a

View File

@ -11,9 +11,8 @@ from helpers.person_helpers import delete_people_below_age
router = APIRouter() router = APIRouter()
@router.delete("/people", status_code=200) @router.delete("/people", status_code=200)
async def delete_people_under_age( async def delete_people_under_50(
age: int = 50,
db: Session = Depends(get_db) db: Session = Depends(get_db)
): ):
deleted_count = delete_people_below_age(db, age) delete_people_below_age(db, 50)
return {"message": f"Deleted {deleted_count} people below age {age}"} return {"message": "People below 50 years old have been deleted."}