Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Commit

Permalink
Allow no results
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosgood committed Jan 10, 2024
1 parent 9f88aac commit 92c7ccd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/schemas/api_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ def get_result_range_max(self):
return page_max if page_max <= self.count else self.count

def page_in_range(self):
return self.page > 0 and self.page <= self.get_pages()
return self.get_pages() == 0 or (
self.page > 0 and self.page <= self.get_pages()
)

def toJSON(self):
if self.page_in_range():
Expand Down

0 comments on commit 92c7ccd

Please # to comment.