Update code in endpoints/peoples.delete.py
This commit is contained in:
parent
ae6af1dc8a
commit
82711639b2
18
endpoints/peoples.delete.py
Normal file
18
endpoints/peoples.delete.py
Normal file
@ -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"}
|
Loading…
x
Reference in New Issue
Block a user