Update code in endpoints/people.delete.py
This commit is contained in:
parent
b00b491059
commit
ae6af1dc8a
@ -11,9 +11,8 @@ from helpers.person_helpers import delete_people_below_age
|
||||
router = APIRouter()
|
||||
|
||||
@router.delete("/people", status_code=200)
|
||||
async def delete_people_under_age(
|
||||
age: int = 50,
|
||||
async def delete_people_under_50(
|
||||
db: Session = Depends(get_db)
|
||||
):
|
||||
deleted_count = delete_people_below_age(db, age)
|
||||
return {"message": f"Deleted {deleted_count} people below age {age}"}
|
||||
delete_people_below_age(db, 50)
|
||||
return {"message": "People below 50 years old have been deleted."}
|
Loading…
x
Reference in New Issue
Block a user