diff options
author | Rémy Coutable <remy@rymai.me> | 2016-02-11 20:13:36 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-02-11 20:13:36 +0300 |
commit | 973a7d040e9dc39fba69015df0123619d3931093 (patch) | |
tree | a21ddfe66a94a79bf01a62b03c8d98862e8f45e3 /lib | |
parent | 9b1dfd3e81855c99b0ccb703d3aecc3f1a7ac7c9 (diff) | |
parent | b91d1890a8f33566d52c653e9ae083a3a3329590 (diff) |
Merge branch 'Schniz/gitlab-ce-feature/merge-request-closes-issues-in-api' into 'master'
Add merge_requests/:merge_request_id/closes_issues
_Originally opened at !2660 by @Schniz._
- - -
Added `/api/v3/projects/:id/merge_requests/:merge_request_id/closes_issues` route in the API for getting the issues that should be closed when a merge request merged successfully
See merge request !2779
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/merge_requests.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/api/merge_requests.rb b/lib/api/merge_requests.rb index dd7f24f3279..4230c68abb2 100644 --- a/lib/api/merge_requests.rb +++ b/lib/api/merge_requests.rb @@ -300,6 +300,19 @@ module API render_api_error!("Failed to save note #{note.errors.messages}", 400) end end + + # List issues that will close on merge + # + # Parameters: + # id (required) - The ID of a project + # merge_request_id (required) - ID of MR + # Examples: + # GET /projects/:id/merge_requests/:merge_request_id/closes_issues + 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)) + present paginate(issues), with: Entities::Issue + end end end end |