From c280acb00b3d4f3e071bfd36eecc8fffcebc2bb2 Mon Sep 17 00:00:00 2001 From: Robert Schilling Date: Mon, 20 Feb 2017 20:32:44 +0100 Subject: Backport API to V3 --- lib/api/v3/system_hooks.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib/api/v3/system_hooks.rb') diff --git a/lib/api/v3/system_hooks.rb b/lib/api/v3/system_hooks.rb index 391510b9ee0..5787c06fc12 100644 --- a/lib/api/v3/system_hooks.rb +++ b/lib/api/v3/system_hooks.rb @@ -13,6 +13,19 @@ module API get do present SystemHook.all, with: ::API::Entities::Hook end + + desc 'Delete a hook' do + success ::API::Entities::Hook + end + params do + requires :id, type: Integer, desc: 'The ID of the system hook' + end + delete ":id" do + hook = SystemHook.find_by(id: params[:id]) + not_found!('System hook') unless hook + + present hook.destroy, with: ::API::Entities::Hook + end end end end -- cgit v1.2.1