diff options
author | Stan Hu <stanhu@gmail.com> | 2018-07-05 21:11:16 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-07-05 21:11:16 -0700 |
commit | 12b031ce8f1240785cd74f10cfdafb151c3f924b (patch) | |
tree | 05ef77b7bd9788c278eeeddab09be0ac1d2ebb44 /lib/bitbucket_server | |
parent | 022a0c2fdee1cb802b2a4999a472c1c2b760b312 (diff) | |
download | gitlab-ce-12b031ce8f1240785cd74f10cfdafb151c3f924b.tar.gz |
Fix pagination
Diffstat (limited to 'lib/bitbucket_server')
-rw-r--r-- | lib/bitbucket_server/connection.rb | 2 | ||||
-rw-r--r-- | lib/bitbucket_server/paginator.rb | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/bitbucket_server/connection.rb b/lib/bitbucket_server/connection.rb index 092c878c93b..c5e40a3964c 100644 --- a/lib/bitbucket_server/connection.rb +++ b/lib/bitbucket_server/connection.rb @@ -16,7 +16,7 @@ module BitbucketServer def get(path, extra_query = {}) response = Gitlab::HTTP.get(build_url(path), basic_auth: auth, - params: extra_query) + query: extra_query) check_errors!(response) response.parsed_response diff --git a/lib/bitbucket_server/paginator.rb b/lib/bitbucket_server/paginator.rb index c995cf4c3bd..a17045be97e 100644 --- a/lib/bitbucket_server/paginator.rb +++ b/lib/bitbucket_server/paginator.rb @@ -1,6 +1,6 @@ module BitbucketServer class Paginator - PAGE_LENGTH = 25 # The minimum length is 10 and the maximum is 100. + PAGE_LENGTH = 25 def initialize(connection, url, type) @connection = connection @@ -24,12 +24,12 @@ module BitbucketServer page.nil? || page.next? end - def next_url - page.nil? ? url : page.next + def next_offset + page.nil? ? 0 : page.next end def fetch_next_page - parsed_response = connection.get(next_url, pagelen: PAGE_LENGTH, sort: :created_on) + parsed_response = connection.get(@url, start: next_offset, limit: PAGE_LENGTH) Page.new(parsed_response, type) end end |