diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2017-02-28 10:56:09 +0530 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2017-03-07 13:55:59 +0530 |
commit | 402e0a2dd7cd9aa6766500b9b6809c97dfd40912 (patch) | |
tree | d6cc29ecf0710e141d266ba0d46223f44454c486 /lib | |
parent | 719327112c2df2d842c4beb993745db1c95950fe (diff) | |
download | gitlab-ce-402e0a2dd7cd9aa6766500b9b6809c97dfd40912.tar.gz |
Migrate the MergeRequestDiffs API to use `merge_request_iid`
- Instead of `merge_request_id`
- Duplicate the original `MergeRequestDiffs` API (and spec) for use with the V3
API, since this is a breaking change.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/merge_request_diffs.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/api/merge_request_diffs.rb b/lib/api/merge_request_diffs.rb index 4901a7cfea6..a59e39cca26 100644 --- a/lib/api/merge_request_diffs.rb +++ b/lib/api/merge_request_diffs.rb @@ -13,11 +13,11 @@ 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' + requires :merge_request_iid, type: Integer, desc: 'The IID 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]) + get ":id/merge_requests/:merge_request_iid/versions" do + merge_request = find_merge_request_with_access(params[:merge_request_iid]) present paginate(merge_request.merge_request_diffs), with: Entities::MergeRequestDiff end @@ -29,12 +29,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' + requires :merge_request_iid, type: Integer, desc: 'The IID of a merge request' requires :version_id, type: Integer, desc: 'The ID of a merge request diff version' end - get ":id/merge_requests/:merge_request_id/versions/:version_id" do - merge_request = find_merge_request_with_access(params[:merge_request_id]) + get ":id/merge_requests/:merge_request_iid/versions/:version_id" do + merge_request = find_merge_request_with_access(params[:merge_request_iid]) present merge_request.merge_request_diffs.find(params[:version_id]), with: Entities::MergeRequestDiffFull end |