From 63f6676eacdd156f84d35cbbcbc8e2243caf9846 Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Fri, 11 Apr 2025 20:31:34 +0000 Subject: [PATCH] feat: Updated endpoint endpoints/names.post.py via AI --- endpoints/names.post.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/endpoints/names.post.py b/endpoints/names.post.py index 09d5cbf..9835b10 100644 --- a/endpoints/names.post.py +++ b/endpoints/names.post.py @@ -1,13 +1,14 @@ -from fastapi import APIRouter, Depends -from sqlalchemy.orm import Session -from typing import List -from core.database import get_db -from helpers.fruit_helpers import get_all_fruit_names +from fastapi import APIRouter +from fastapi.responses import JSONResponse +from helpers.fruit_helpers import get_all_fruits router = APIRouter() -@router.post("/names", status_code=200, response_model=List[str]) -async def get_fruit_names(db: Session = Depends(get_db)): - """Get all fruit names""" - names = get_all_fruit_names(db) - return names \ No newline at end of file +@router.post("/names") +async def update_route_description(): + """get all fruits with joy!""" + fruits = get_all_fruits() + return JSONResponse( + status_code=200, + content={"message": "Route description updated", "fruits": fruits} + ) \ No newline at end of file