summaryrefslogtreecommitdiff
path: root/lib/api/environments.rb
diff options
context:
space:
mode:
authorSimon Knox <psimyn@gmail.com>2017-09-06 14:35:58 +1000
committerSimon Knox <psimyn@gmail.com>2017-09-06 14:35:58 +1000
commitb9aa55e1ea2ba226bd9bf4c6fb08fdec30e046c5 (patch)
treeb7770180f178086c78ef2ca25d6bb2267f739110 /lib/api/environments.rb
parent74740604211dab6632771f1bfd7dd67902fea7ef (diff)
parentd68ff7f50a93ebbff537b5e795cf6bf80bd66a6e (diff)
downloadgitlab-ce-b9aa55e1ea2ba226bd9bf4c6fb08fdec30e046c5.tar.gz
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into ee_issue_928_backport
Diffstat (limited to 'lib/api/environments.rb')
-rw-r--r--lib/api/environments.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/api/environments.rb b/lib/api/environments.rb
index c774a5c6685..5c63ec028d9 100644
--- a/lib/api/environments.rb
+++ b/lib/api/environments.rb
@@ -9,7 +9,7 @@ module API
params do
requires :id, type: String, desc: 'The project ID'
end
- resource :projects, requirements: { id: %r{[^/]+} } do
+ resource :projects, requirements: API::PROJECT_ENDPOINT_REQUIREMENTS do
desc 'Get all environments of the project' do
detail 'This feature was introduced in GitLab 8.11.'
success Entities::Environment
@@ -79,8 +79,7 @@ module API
environment = user_project.environments.find(params[:environment_id])
- status 204
- environment.destroy
+ destroy_conditionally!(environment)
end
desc 'Stops an existing environment' do