diff --git a/endpoints/flowers.get.py b/endpoints/flowers.get.py new file mode 100644 index 0000000..8b7f443 --- /dev/null +++ b/endpoints/flowers.get.py @@ -0,0 +1,18 @@ +# Entity: Flower + +from fastapi import APIRouter, Depends +from typing import List +from core.database import get_db +from sqlalchemy.orm import Session +from models.flower import Flower +from schemas.flower import FlowerSchema +from helpers.flower_helpers import get_all_flowers + +router = APIRouter() + +@router.get("/flowers", status_code=200, response_model=List[FlowerSchema]) +async def get_flowers( + db: Session = Depends(get_db) +): + flowers = get_all_flowers(db) + return flowers \ No newline at end of file