string-yoeiz4/endpoints/names.post.py

14 lines
401 B
Python

from fastapi import APIRouter
from fastapi.responses import JSONResponse
from helpers.fruit_helpers import get_all_fruits
router = APIRouter()
@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}
)