oldman-id8uj6/endpoints/males.get.py
2025-03-28 09:27:53 +01:00

16 lines
390 B
Python

# Entity: Male
from fastapi import APIRouter, Depends
from typing import List
from models.male import Male
from schemas.male import MaleSchema
from helpers.male_helpers import get_all_males
router = APIRouter()
@router.get("/males", status_code=200, response_model=List[MaleSchema])
async def get_males(
db: Session = Depends(get_db)
):
males = get_all_males(db)
return males