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:
parent
42c811c112
commit
2860552c94
1 changed files with 2 additions and 1 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue