Add GET endpoint for /names

This commit is contained in:
Backend IM Bot 2025-03-27 05:31:27 -05:00
parent 802bda8a73
commit 58824736e2

15
endpoints/names.get.py Normal file
View 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