12 lines
419 B
Python

from fastapi import APIRouter, Depends, status
from sqlalchemy.orm import Session
from typing import List
from core.database import get_db
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_fruit_names(db: Session = Depends(get_db)):
"""Get all fruit names"""
return get_all_fruit_names(db)