From 1ce1f13ef7e6d8e151bc16eee60d62f3f954ce44 Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Fri, 28 Mar 2025 19:08:14 +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