Update code in endpoints/ypeople.get.py

This commit is contained in:
Backend IM Bot 2025-03-27 19:38:17 +01:00
parent 2ce79124f7
commit 5249a4cfe8

18
endpoints/ypeople.get.py Normal file
View File

@ -0,0 +1,18 @@
# Entity: Person
from fastapi import APIRouter, Depends
from typing import List
from core.database import get_db
from sqlalchemy.orm import Session
from models.person import Person
from schemas.person import PersonSchema
from helpers.person_helpers import get_people_below_age
router = APIRouter()
@router.get("/ypeople", status_code=200, response_model=List[PersonSchema])
async def get_young_people(
db: Session = Depends(get_db)
):
young_people = get_people_below_age(db, 40)
return young_people