Update code in endpoints/males.get.py
This commit is contained in:
parent
2ca5862e46
commit
284cdd5063
18
endpoints/males.get.py
Normal file
18
endpoints/males.get.py
Normal file
@ -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
|
Loading…
x
Reference in New Issue
Block a user