11 lines
338 B
Python

from fastapi import APIRouter, status
from typing import List
from helpers.fruit_helpers import get_all_fruit_names
router = APIRouter()
@router.post("/names", status_code=status.HTTP_200_OK, response_model=List[str])
async def get_names():
"""Return all fruit names"""
fruit_names = get_all_fruit_names()
return fruit_names