Browse Source

Update gitea hooks api

tags/v1.0.0
Jasder 5 years ago
parent
commit
a8821de85f
3 changed files with 8 additions and 8 deletions
  1. +1
    -1
      app/services/gitea/hooks/create_service.rb
  2. +1
    -1
      app/services/gitea/hooks/list_service.rb
  3. +6
    -6
      app/services/gitea/hooks/update_service.rb

+ 1
- 1
app/services/gitea/hooks/create_service.rb View File

@@ -29,7 +29,7 @@ class Gitea::Hooks::CreateService < Gitea::ClientService

private
def params
Hash.new.merge(token: token, data: body).compact!
Hash.new.merge(token: token, data: body).compact
end

def url


+ 1
- 1
app/services/gitea/hooks/list_service.rb View File

@@ -17,7 +17,7 @@ class Gitea::Hooks::ListService < Gitea::ClientService
Hash.new.merge(token: token,
page: params[:page],
limit: params[:limit]
).compact!
).compact
end

def url


+ 6
- 6
app/services/gitea/hooks/update_service.rb View File

@@ -2,14 +2,14 @@ class Gitea::Hooks::UpdateService < Gitea::ClientService
attr_reader :user, :repo_name, :body,:hook_id

def initialize(user, repo_name, body, hook_id)
@user = user
@repo_name = repo_name
@body = body
@user = user
@repo_name = repo_name
@body = body
@hook_id = hook_id
end

def call
response = patch(url, params)
def call
patch(url, params)
end

private
@@ -21,4 +21,4 @@ class Gitea::Hooks::UpdateService < Gitea::ClientService
"/repos/#{user.login}/#{repo_name}/hooks/#{hook_id}".freeze
end

end
end

Loading…
Cancel
Save