diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2017-02-25 15:25:32 +0300 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2017-03-07 10:36:42 +0300 |
commit | 719327112c2df2d842c4beb993745db1c95950fe (patch) | |
tree | f3df84cf3c1f92e4571ab668096f5742fbe8ead9 /lib/api/helpers.rb | |
parent | dd99622347e639e468b0538ebb57170c1299c858 (diff) |
API routes referencing a specific merge request should use the MR `iid`
- As opposed to the `id` that was previously being used.
- This brings the API routes closer to the web interface's routes.
- This is specific to API v4.
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r-- | lib/api/helpers.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index 2358a951bf1..a9b364da9e1 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -86,12 +86,12 @@ module API IssuesFinder.new(current_user, project_id: user_project.id).find_by!(iid: iid) end - def find_project_merge_request(id) - MergeRequestsFinder.new(current_user, project_id: user_project.id).find(id) + def find_project_merge_request(iid) + MergeRequestsFinder.new(current_user, project_id: user_project.id).find_by!(iid: iid) end - def find_merge_request_with_access(id, access_level = :read_merge_request) - merge_request = user_project.merge_requests.find(id) + def find_merge_request_with_access(iid, access_level = :read_merge_request) + merge_request = user_project.merge_requests.find_by!(iid: iid) authorize! access_level, merge_request merge_request end |