From 5d4390e9ebb4eebb7af38e45d70ea4bd0f5a3856 Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Thu, 27 Mar 2025 13:36:51 -0500 Subject: [PATCH] Add GET endpoint for flowers --- endpoints/flowers.get.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 endpoints/flowers.get.py 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