diff options
author | Rémy Coutable <remy@rymai.me> | 2017-04-26 11:45:10 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-04-26 11:45:10 +0000 |
commit | f8f49cf516dd1055b5ee47172bf5997c3f679503 (patch) | |
tree | 57be46da2b61b418addf5ef5a6f71412c20a8515 /lib | |
parent | d255425b8c618d389268d67ed3af1cb432fc4ef3 (diff) | |
parent | 327e344417888abbbc0811a8068c96c1af6fd326 (diff) | |
download | gitlab-ce-f8f49cf516dd1055b5ee47172bf5997c3f679503.tar.gz |
Merge branch '26437-closed-by' into 'master'
Add issues/:iid/closed_by api endpoint
Closes #26437
See merge request !10511
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/issues.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/api/issues.rb b/lib/api/issues.rb index 244725bb292..522f0f3be92 100644 --- a/lib/api/issues.rb +++ b/lib/api/issues.rb @@ -219,6 +219,21 @@ module API authorize!(:destroy_issue, issue) issue.destroy end + + desc 'List merge requests closing issue' do + success Entities::MergeRequestBasic + end + params do + requires :issue_iid, type: Integer, desc: 'The internal ID of a project issue' + end + get ':id/issues/:issue_iid/closed_by' do + issue = find_project_issue(params[:issue_iid]) + + merge_request_ids = MergeRequestsClosingIssues.where(issue_id: issue).select(:merge_request_id) + merge_requests = MergeRequestsFinder.new(current_user, project_id: user_project.id).execute.where(id: merge_request_ids) + + present paginate(merge_requests), with: Entities::MergeRequestBasic, current_user: current_user, project: user_project + end end end end |