From 92c7ccdb5c019f058f78d816f15b20a90c00a6b3 Mon Sep 17 00:00:00 2001 From: Andrew Hosgood Date: Wed, 10 Jan 2024 18:34:57 +0000 Subject: [PATCH] Allow no results --- app/schemas/api_response.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/schemas/api_response.py b/app/schemas/api_response.py index dc09534..cf645ba 100644 --- a/app/schemas/api_response.py +++ b/app/schemas/api_response.py @@ -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():