From 58824736e2fa99680cb7451780d0dd3765cd4e36 Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Thu, 27 Mar 2025 05:31:27 -0500 Subject: [PATCH] Add GET endpoint for /names --- endpoints/names.get.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 endpoints/names.get.py diff --git a/endpoints/names.get.py b/endpoints/names.get.py new file mode 100644 index 0000000..749d695 --- /dev/null +++ b/endpoints/names.get.py @@ -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 \ No newline at end of file