Fix total_pages calculation to respect X-Per-Page header

The total_pages method was using the hardcoded SEARCH_PER_PAGE constant
instead of the dynamic search_page_size value from the X-Per-Page header.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Justin Edmund 2025-09-17 05:59:41 -07:00
parent 42c811c112
commit 2860552c94

View file

@ -275,7 +275,8 @@ module Api
private
def total_pages(count)
count.to_f / SEARCH_PER_PAGE > 1 ? (count.to_f / SEARCH_PER_PAGE).ceil : 1
per_page = search_page_size
(count.to_f / per_page).ceil
end
# Specify whitelisted properties that can be modified.