diff options
author | Jordan Patterson <jordan@jpatterson.me> | 2017-08-17 09:18:07 -0300 |
---|---|---|
committer | Toon Claes <toon@iotcl.com> | 2017-08-17 21:47:01 +0200 |
commit | fdf4f0fc0884c0346b16ec107a1ea1084dd4a32f (patch) | |
tree | a0facb5f7bc55f57a0f50e4088883e912a3c9814 /lib/api/helpers/pagination.rb | |
parent | f0ac0daf6a8788f57b98eaf29b0056899027ae68 (diff) | |
download | gitlab-ce-fdf4f0fc0884c0346b16ec107a1ea1084dd4a32f.tar.gz |
don't add next page link if current page is out of range
Diffstat (limited to 'lib/api/helpers/pagination.rb')
-rw-r--r-- | lib/api/helpers/pagination.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/api/helpers/pagination.rb b/lib/api/helpers/pagination.rb index 0764b58fb4c..e86e221e092 100644 --- a/lib/api/helpers/pagination.rb +++ b/lib/api/helpers/pagination.rb @@ -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") |