12 lines
334 B
Python
12 lines
334 B
Python
from fastapi import APIRouter
|
|
from typing import List
|
|
from schemas.fruit import FruitSchema
|
|
from helpers.fruit_helpers import get_all_fruits
|
|
|
|
router = APIRouter()
|
|
|
|
@router.get("/fruits", status_code=200, response_model=List[FruitSchema])
|
|
async def get_fruits():
|
|
"""Get all fruits"""
|
|
fruits = get_all_fruits()
|
|
return fruits |