summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorNermin Vehabovic <nermin.vehabovic90@gmail.com>2019-02-26 23:18:40 +0000
committerStan Hu <stanhu@gmail.com>2019-02-26 23:18:40 +0000
commitf9e38cd39f7bbe4fc9a9e437d745270f01edc68b (patch)
treeba0a25ebf130324f3d805685360a77a02683f9d4 /lib/api
parent3ae5e475293b4143ed6af530da0d2ab8d9fba56a (diff)
downloadgitlab-ce-f9e38cd39f7bbe4fc9a9e437d745270f01edc68b.tar.gz
Added: Documentation for the API
Added: Specs for the API action
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/project_milestones.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/api/project_milestones.rb b/lib/api/project_milestones.rb
index da31bcb8dac..ca24742b7a3 100644
--- a/lib/api/project_milestones.rb
+++ b/lib/api/project_milestones.rb
@@ -98,6 +98,23 @@ module API
milestone_issuables_for(user_project, :merge_request)
end
+
+ desc 'Promote a milestone to group milestone' do
+ detail 'This feature was introduced in GitLab 11.9'
+ end
+ post ':id/milestones/:milestone_id/promote' do
+ begin
+ authorize! :admin_milestone, user_project
+ authorize! :admin_milestone, user_project.group
+
+ milestone = user_project.milestones.find(params[:milestone_id])
+ Milestones::PromoteService.new(user_project, current_user).execute(milestone)
+
+ status(200)
+ rescue Milestones::PromoteService::PromoteMilestoneError => error
+ render_api_error!(error.message, 400)
+ end
+ end
end
end
end