Add GET endpoint for /names
This commit is contained in:
parent
802bda8a73
commit
58824736e2
15
endpoints/names.get.py
Normal file
15
endpoints/names.get.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# Entity: Name
|
||||||
|
|
||||||
|
from fastapi import APIRouter, Depends, status
|
||||||
|
from typing import List
|
||||||
|
from schemas.name import NameSchema
|
||||||
|
from helpers.name_helpers import get_girl_names
|
||||||
|
|
||||||
|
router = APIRouter()
|
||||||
|
|
||||||
|
@router.get("/names", status_code=200, response_model=List[NameSchema])
|
||||||
|
async def get_girl_names_endpoint(
|
||||||
|
db: Session = Depends(get_db)
|
||||||
|
):
|
||||||
|
girl_names = get_girl_names(db)
|
||||||
|
return girl_names
|
Loading…
x
Reference in New Issue
Block a user