diff options
author | Adam Niedzielski <adamsunday@gmail.com> | 2017-03-06 12:48:10 +0100 |
---|---|---|
committer | Adam Niedzielski <adamsunday@gmail.com> | 2017-03-06 14:17:07 +0100 |
commit | c727d4328fa14c4e90eb47c04f045c0f54224018 (patch) | |
tree | b44e0a483f82b0902a3cdc52b17fb8be1269db26 /lib/api/v3 | |
parent | 5753acfabc20b97f3ff8f9767382b960a4a9e95a (diff) | |
download | gitlab-ce-api-drop-subscribed.tar.gz |
Remove "subscribed" field from API responses returning list of issues or merge requestsapi-drop-subscribed
Diffstat (limited to 'lib/api/v3')
-rw-r--r-- | lib/api/v3/merge_requests.rb | 8 | ||||
-rw-r--r-- | lib/api/v3/milestones.rb | 21 |
2 files changed, 29 insertions, 0 deletions
diff --git a/lib/api/v3/merge_requests.rb b/lib/api/v3/merge_requests.rb index 654e818e1b5..7dbd4691a94 100644 --- a/lib/api/v3/merge_requests.rb +++ b/lib/api/v3/merge_requests.rb @@ -28,6 +28,14 @@ module API render_api_error!(errors, 400) end + def issue_entity(project) + if project.has_external_issue_tracker? + ::API::Entities::ExternalIssue + else + ::API::Entities::Issue + end + end + params :optional_params do optional :description, type: String, desc: 'The description of the merge request' optional :assignee_id, type: Integer, desc: 'The ID of a user to assign the merge request' diff --git a/lib/api/v3/milestones.rb b/lib/api/v3/milestones.rb index bbc29c40ee2..2a850a08a8a 100644 --- a/lib/api/v3/milestones.rb +++ b/lib/api/v3/milestones.rb @@ -37,6 +37,27 @@ module API present paginate(milestones), with: ::API::Entities::Milestone end + + desc 'Get all issues for a single project milestone' do + success ::API::Entities::Issue + end + params do + requires :milestone_id, type: Integer, desc: 'The ID of a project milestone' + use :pagination + end + get ':id/milestones/:milestone_id/issues' do + authorize! :read_milestone, user_project + + milestone = user_project.milestones.find(params[:milestone_id]) + + finder_params = { + project_id: user_project.id, + milestone_title: milestone.title + } + + issues = IssuesFinder.new(current_user, finder_params).execute + present paginate(issues), with: ::API::Entities::Issue, current_user: current_user, project: user_project + end end end end |