diff options
author | Robert Schilling <rschilling@student.tugraz.at> | 2017-01-17 07:45:07 +0300 |
---|---|---|
committer | Robert Schilling <rschilling@student.tugraz.at> | 2017-02-16 17:32:01 +0300 |
commit | 01ea65e0e9ea5e44fa653fb95e7ba8ca1668af98 (patch) | |
tree | b7360600a01fff3a1e47a4d8c4f00b42d81fe836 /lib/api/merge_request_diffs.rb | |
parent | 28d8b8650759d0032bcfd0fd9b4397d139a43984 (diff) |
Paginate all endpoints that return an array
Diffstat (limited to 'lib/api/merge_request_diffs.rb')
-rw-r--r-- | lib/api/merge_request_diffs.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/api/merge_request_diffs.rb b/lib/api/merge_request_diffs.rb index bc3d69f6904..4901a7cfea6 100644 --- a/lib/api/merge_request_diffs.rb +++ b/lib/api/merge_request_diffs.rb @@ -1,6 +1,8 @@ module API # MergeRequestDiff API class MergeRequestDiffs < Grape::API + include PaginationParams + before { authenticate! } resource :projects do @@ -12,12 +14,12 @@ module API params do requires :id, type: String, desc: 'The ID of a project' requires :merge_request_id, type: Integer, desc: 'The ID of a merge request' + use :pagination end - get ":id/merge_requests/:merge_request_id/versions" do merge_request = find_merge_request_with_access(params[:merge_request_id]) - present merge_request.merge_request_diffs, with: Entities::MergeRequestDiff + present paginate(merge_request.merge_request_diffs), with: Entities::MergeRequestDiff end desc 'Get a single merge request diff version' do |