Skip to content

Commit

Permalink
fix: return empty list when error (#52)
Browse files Browse the repository at this point in the history
* fix: return empty list when error

* fix: black
  • Loading branch information
Valimp authored May 15, 2024
1 parent 96c42b1 commit fc472cb
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions app/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit fc472cb

Please sign in to comment.