diff --git a/app/schemas/api_response.py b/app/schemas/api_response.py index a880337..dc09534 100644 --- a/app/schemas/api_response.py +++ b/app/schemas/api_response.py @@ -28,7 +28,8 @@ def get_result_range_min(self): return (self.results_per_page * (self.page - 1)) + 1 def get_result_range_max(self): - return self.results_per_page * self.page + page_max = self.results_per_page * self.page + 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()