From fc472cbe80a319afaf0fd7ca785ecb65ad870e7a Mon Sep 17 00:00:00 2001 From: Valimp <112864841+Valimp@users.noreply.github.com> Date: Wed, 15 May 2024 14:01:19 +0200 Subject: [PATCH] fix: return empty list when error (#52) * fix: return empty list when error * fix: black --- app/api.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/api.py b/app/api.py index 02421d7..4883316 100644 --- a/app/api.py +++ b/app/api.py @@ -383,10 +383,7 @@ def get_tickets( ) max_page = count // page_size + int(count % page_size != 0) if page > max_page: - raise HTTPException( - status_code=404, - detail=f"Page {page} not found. Max page is {max_page}", - ) + return {"tickets": [], "max_page": max_page} return { "tickets": list( TicketModel.select()