13 lines
414 B
Python
13 lines
414 B
Python
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
|
|
|
|
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 |