diff options
author | Gal Schlezinger <galstar@spitfire.co.il> | 2016-01-31 11:05:47 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-02-11 09:34:07 +0100 |
commit | 78e36780be31257a59cb3076ba5402e380ca240f (patch) | |
tree | c51ae129173c76bd1e808731f8f63dc9e999ae40 /lib/api/merge_requests.rb | |
parent | bce482a59a235edf1607dab73dff88aba4300012 (diff) | |
download | gitlab-ce-78e36780be31257a59cb3076ba5402e380ca240f.tar.gz |
Added '/api/v3/projects/:id/merge_requests/:merge_request_id/closes_issues' route in the API
Added some documentation for it
Added to changelog
Added curl example and an attribute table
Moved the api route definition from "lib/api/issues.rb" to "lib/api/merge_requests.rb"
Fixed the attributes and changed the documentation to be at "merge_requests.md" too
Changed generic titles to more specific titles
added an underscore
added tests. it depends on a newer version of gitlab-test project
I'm doing a since I need to add a branch to the `gitlab-test` repo
removed the before
using 'iid' instead of 'id' in the description to reference the issues. that makes the tests pass
Removed the 'closes-issues' key from test_env. so it should pass the tests
Moved the two initializations to the describe block
Changed the changelog
Diffstat (limited to 'lib/api/merge_requests.rb')
-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..004ff52c1d3 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) + present paginate(issues), with: Entities::Issue + end end end end |