Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2017-08-24 11:41:54 +0300
committerRobert Schilling <rschilling@student.tugraz.at>2017-08-28 18:10:30 +0300
commitdcd4ea473cab20eee05995ecaca043da98ca5a8d (patch)
treeaf1c7e0fb076cdc707bae65420419ac671e26b0a /lib/api/services.rb
parentf0f3f38576c0691e6d0e751c962382beea998afb (diff)
Update remaining endpoints
Diffstat (limited to 'lib/api/services.rb')
-rw-r--r--lib/api/services.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/api/services.rb b/lib/api/services.rb
index 2b5ef75b6bf..ff9ddd44439 100644
--- a/lib/api/services.rb
+++ b/lib/api/services.rb
@@ -655,15 +655,15 @@ module API
end
delete ":id/services/:service_slug" do
service = user_project.find_or_initialize_service(params[:service_slug].underscore)
- # Todo: Check if this done the right way
- check_unmodified_since!(service.updated_at)
- attrs = service_attributes(service).inject({}) do |hash, key|
- hash.merge!(key => nil)
- end
+ destroy_conditionally!(service) do
+ attrs = service_attributes(service).inject({}) do |hash, key|
+ hash.merge!(key => nil)
+ end
- unless service.update_attributes(attrs.merge(active: false))
- render_api_error!('400 Bad Request', 400)
+ unless service.update_attributes(attrs.merge(active: false))
+ render_api_error!('400 Bad Request', 400)
+ end
end
end