diff options
author | Rémy Coutable <remy@rymai.me> | 2016-12-05 15:11:14 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-12-05 15:11:14 +0300 |
commit | d134c72523fb54d4b5e21a160553839099c4ab35 (patch) | |
tree | a3619abe4e61a58da8fd2385ce3cefe756c65e55 /lib/api/merge_requests.rb | |
parent | 9cbee6ecf34191d04c0c85be79828fb08de2abf6 (diff) | |
parent | 74c8669b0a96b6afcb41ce5e09b147c7309ecbeb (diff) |
Merge branch 'use-pagination-helper' into 'master'
Use the pagination helper in the API
See merge request !7920
Diffstat (limited to 'lib/api/merge_requests.rb')
-rw-r--r-- | lib/api/merge_requests.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/api/merge_requests.rb b/lib/api/merge_requests.rb index ad9b3d8039f..253460830ff 100644 --- a/lib/api/merge_requests.rb +++ b/lib/api/merge_requests.rb @@ -1,5 +1,7 @@ module API class MergeRequests < Grape::API + include PaginationParams + DEPRECATION_MESSAGE = 'This endpoint is deprecated and will be removed in GitLab 9.0.'.freeze before { authenticate! } @@ -42,6 +44,7 @@ module API optional :sort, type: String, values: %w[asc desc], default: 'desc', desc: 'Return merge requests sorted in `asc` or `desc` order.' optional :iid, type: Array[Integer], desc: 'The IID of the merge requests' + use :pagination end get ":id/merge_requests" do authorize! :read_merge_request, user_project @@ -222,6 +225,9 @@ module API detail 'Duplicate. DEPRECATED and WILL BE REMOVED in 9.0' success Entities::MRNote end + params do + use :pagination + end get "#{path}/comments" do merge_request = user_project.merge_requests.find(params[:merge_request_id]) @@ -259,6 +265,9 @@ module API desc 'List issues that will be closed on merge' do success Entities::MRNote end + params do + use :pagination + end get "#{path}/closes_issues" do merge_request = user_project.merge_requests.find(params[:merge_request_id]) issues = ::Kaminari.paginate_array(merge_request.closes_issues(current_user)) |