diff options
author | Robert Schilling <rschilling@student.tugraz.at> | 2017-02-20 20:32:44 +0100 |
---|---|---|
committer | Robert Schilling <rschilling@student.tugraz.at> | 2017-02-28 08:32:39 +0100 |
commit | c280acb00b3d4f3e071bfd36eecc8fffcebc2bb2 (patch) | |
tree | f806ba67c4c22945d8a9e6a66c108d3d37e9bd65 /lib/api/v3/system_hooks.rb | |
parent | f2dd2604134ac62301db765ff0b14ff692e21bd6 (diff) | |
download | gitlab-ce-c280acb00b3d4f3e071bfd36eecc8fffcebc2bb2.tar.gz |
Backport API to V3
Diffstat (limited to 'lib/api/v3/system_hooks.rb')
-rw-r--r-- | lib/api/v3/system_hooks.rb | 13 |
1 files changed, 13 insertions, 0 deletions
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 |