Commit fdf4f0fc authored by Jordan Patterson's avatar Jordan Patterson Committed by Toon Claes

don't add next page link if current page is out of range

parent f0ac0daf
...@@ -30,7 +30,7 @@ module API ...@@ -30,7 +30,7 @@ module API
links << %(<#{request_url}?#{request_params.to_query}>; rel="prev") unless paginated_data.first_page? links << %(<#{request_url}?#{request_params.to_query}>; rel="prev") unless paginated_data.first_page?
request_params[:page] = paginated_data.current_page + 1 request_params[:page] = paginated_data.current_page + 1
links << %(<#{request_url}?#{request_params.to_query}>; rel="next") unless paginated_data.last_page? links << %(<#{request_url}?#{request_params.to_query}>; rel="next") unless paginated_data.last_page? || paginated_data.out_of_range?
request_params[:page] = 1 request_params[:page] = 1
links << %(<#{request_url}?#{request_params.to_query}>; rel="first") links << %(<#{request_url}?#{request_params.to_query}>; rel="first")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment