From 284cdd5063643d5614108443a46c93cd2d306c65 Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Fri, 28 Mar 2025 09:11:04 +0100 Subject: [PATCH] Update code in endpoints/males.get.py --- endpoints/males.get.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 endpoints/males.get.py diff --git a/endpoints/males.get.py b/endpoints/males.get.py new file mode 100644 index 0000000..6d46080 --- /dev/null +++ b/endpoints/males.get.py @@ -0,0 +1,18 @@ +# Entity: Male + +from fastapi import APIRouter, Depends, status +from sqlalchemy.orm import Session +from typing import List +from core.database import get_db +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 \ No newline at end of file