提交 fdf4f0fc 编写于 作者: J Jordan Patterson 提交者: Toon Claes

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

上级 f0ac0daf
......@@ -30,7 +30,7 @@ module API
links << %(<#{request_url}?#{request_params.to_query}>; rel="prev") unless paginated_data.first_page?
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
links << %(<#{request_url}?#{request_params.to_query}>; rel="first")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册