diff options
Diffstat (limited to 'lib/api/system_hooks.rb')
-rw-r--r-- | lib/api/system_hooks.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/api/system_hooks.rb b/lib/api/system_hooks.rb index 51fae0e54aa..ff4e903ed3c 100644 --- a/lib/api/system_hooks.rb +++ b/lib/api/system_hooks.rb @@ -10,7 +10,7 @@ module API end resource :hooks do - desc 'Get the list of system hooks' do + desc "Get the list of system hooks" do success Entities::Hook end params do @@ -20,12 +20,12 @@ module API present paginate(SystemHook.all), with: Entities::Hook end - desc 'Create a new system hook' do + desc "Create a new system hook" do success Entities::Hook end params do requires :url, type: String, desc: "The URL to send the request to" - optional :token, type: String, desc: 'The token used to validate payloads' + optional :token, type: String, desc: "The token used to validate payloads" optional :push_events, type: Boolean, desc: "Trigger hook on push events" optional :tag_push_events, type: Boolean, desc: "Trigger hook on tag push events" optional :merge_requests_events, type: Boolean, desc: "Trigger hook on tag push events" @@ -41,9 +41,9 @@ module API end end - desc 'Test a hook' + desc "Test a hook" params do - requires :id, type: Integer, desc: 'The ID of the system hook' + requires :id, type: Integer, desc: "The ID of the system hook" end get ":id" do hook = SystemHook.find(params[:id]) @@ -53,22 +53,22 @@ module API path: "ruby", project_id: 1, owner_name: "Someone", - owner_email: "example@gitlabhq.com" + owner_email: "example@gitlabhq.com", } - hook.execute(data, 'system_hooks') + hook.execute(data, "system_hooks") data end - desc 'Delete a hook' do + desc "Delete a hook" do success Entities::Hook end params do - requires :id, type: Integer, desc: 'The ID of the system hook' + requires :id, type: Integer, desc: "The ID of the system hook" end # rubocop: disable CodeReuse/ActiveRecord delete ":id" do hook = SystemHook.find_by(id: params[:id]) - not_found!('System hook') unless hook + not_found!("System hook") unless hook destroy_conditionally!(hook) end |