mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-09 14:34:03 +08:00
init project
This commit is contained in:
26
app/services/gitea/pull_request/update_service.rb
Normal file
26
app/services/gitea/pull_request/update_service.rb
Normal file
@@ -0,0 +1,26 @@
|
||||
class Gitea::PullRequest::UpdateService < Gitea::ClientService
|
||||
attr_reader :user, :repo, :params,:pull_request_id
|
||||
|
||||
|
||||
def initialize(user, repo, params,pull_request_id)
|
||||
@user = user
|
||||
@repo = repo
|
||||
@params = params
|
||||
@pull_request_id = pull_request_id
|
||||
end
|
||||
|
||||
def call
|
||||
put(url, request_params)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def request_params
|
||||
Hash.new.merge(token: @user.gitea_token, data: @params)
|
||||
end
|
||||
|
||||
def url
|
||||
"/repos/#{@user.try(:login)}/#{@repo}/pulls/#{@pull_request_id}".freeze
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user