diff options
author | Brent Greeff <brentgreeff@gmail.com> | 2018-01-05 15:21:53 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-01-05 15:21:53 +0000 |
commit | 34b9cc9674554155af49c9a7fe60aaeba72bb23d (patch) | |
tree | e8efe04e6dc2ae198862a77358c1df430f94c187 /lib/api | |
parent | 6eeb69fc9a216bd1874cba85214af5b1da1a46d0 (diff) | |
download | gitlab-ce-34b9cc9674554155af49c9a7fe60aaeba72bb23d.tar.gz |
API: get participants from merge_requests & issues
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/issues.rb | 13 | ||||
-rw-r--r-- | lib/api/merge_requests.rb | 10 |
2 files changed, 23 insertions, 0 deletions
diff --git a/lib/api/issues.rb b/lib/api/issues.rb index b29c5848aef..7aa10631d53 100644 --- a/lib/api/issues.rb +++ b/lib/api/issues.rb @@ -277,6 +277,19 @@ module API present paginate(merge_requests), with: Entities::MergeRequestBasic, current_user: current_user, project: user_project end + desc 'List participants for an issue' do + success Entities::UserBasic + end + params do + requires :issue_iid, type: Integer, desc: 'The internal ID of a project issue' + end + get ':id/issues/:issue_iid/participants' do + issue = find_project_issue(params[:issue_iid]) + participants = ::Kaminari.paginate_array(issue.participants) + + present paginate(participants), with: Entities::UserBasic, current_user: current_user, project: user_project + end + desc 'Get the user agent details for an issue' do success Entities::UserAgentDetail end diff --git a/lib/api/merge_requests.rb b/lib/api/merge_requests.rb index 02f2b75ab9d..8f665b39fa8 100644 --- a/lib/api/merge_requests.rb +++ b/lib/api/merge_requests.rb @@ -185,6 +185,16 @@ module API present merge_request, with: Entities::MergeRequest, current_user: current_user, project: user_project end + desc 'Get the participants of a merge request' do + success Entities::UserBasic + end + get ':id/merge_requests/:merge_request_iid/participants' do + merge_request = find_merge_request_with_access(params[:merge_request_iid]) + participants = ::Kaminari.paginate_array(merge_request.participants) + + present paginate(participants), with: Entities::UserBasic + end + desc 'Get the commits of a merge request' do success Entities::Commit end |