From 1dab350708e3b357db63cdc2d8737611e876e45d Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Fri, 28 Mar 2025 18:32:23 +0000 Subject: [PATCH] Update code in endpoints/trees.get.py --- endpoints/trees.get.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/endpoints/trees.get.py b/endpoints/trees.get.py index c79570a..9885705 100644 --- a/endpoints/trees.get.py +++ b/endpoints/trees.get.py @@ -8,15 +8,10 @@ from helpers.tree_helpers import get_all_trees router = APIRouter() -@router.get("/trees", response_model=List[TreeSchema], status_code=status.HTTP_200_OK) +@router.get("/trees", status_code=200, response_model=List[TreeSchema]) async def get_trees( db: Session = Depends(get_db) ): """Get all trees""" trees = get_all_trees(db) - if not trees: - raise HTTPException( - status_code=status.HTTP_404_NOT_FOUND, - detail="No trees found" - ) return trees \ No newline at end of file