From 25b0e9f32d309fbf2ae430f6e111fa7fb620b69a Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Fri, 28 Mar 2025 19:06:07 +0000 Subject: [PATCH] Update code in endpoints/endpoint.get.py --- endpoints/endpoint.get.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/endpoints/endpoint.get.py b/endpoints/endpoint.get.py index e69de29..96d5158 100644 --- a/endpoints/endpoint.get.py +++ b/endpoints/endpoint.get.py @@ -0,0 +1,17 @@ +from fastapi import APIRouter, Depends, HTTPException, status +from sqlalchemy.orm import Session +from typing import List +from core.database import get_db +from models.fruit import Fruit +from schemas.fruit import FruitSchema +from helpers.fruit_helpers import get_all_fruits + +router = APIRouter() + +@router.get("/endpoint", status_code=200, response_model=List[FruitSchema]) +async def get_fruits( + db: Session = Depends(get_db) +): + """Get all fruits""" + fruits = get_all_fruits(db) + return fruits \ No newline at end of file