feat: Updated endpoint endpoints/names.post.py via AI
This commit is contained in:
parent
244bfcaed1
commit
63f6676eac
@ -1,13 +1,14 @@
|
|||||||
from fastapi import APIRouter, Depends
|
from fastapi import APIRouter
|
||||||
from sqlalchemy.orm import Session
|
from fastapi.responses import JSONResponse
|
||||||
from typing import List
|
from helpers.fruit_helpers import get_all_fruits
|
||||||
from core.database import get_db
|
|
||||||
from helpers.fruit_helpers import get_all_fruit_names
|
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
@router.post("/names", status_code=200, response_model=List[str])
|
@router.post("/names")
|
||||||
async def get_fruit_names(db: Session = Depends(get_db)):
|
async def update_route_description():
|
||||||
"""Get all fruit names"""
|
"""get all fruits with joy!"""
|
||||||
names = get_all_fruit_names(db)
|
fruits = get_all_fruits()
|
||||||
return names
|
return JSONResponse(
|
||||||
|
status_code=200,
|
||||||
|
content={"message": "Route description updated", "fruits": fruits}
|
||||||
|
)
|
Loading…
x
Reference in New Issue
Block a user