更改:webhook更新返回结构体

This commit is contained in:
2023-04-12 18:34:49 +08:00
parent f64afb8f55
commit 4bd60d458e
7 changed files with 59 additions and 15 deletions

View File

@@ -25,24 +25,24 @@ class TouchWebhookJob < ApplicationJob
end
when 'IssueAssign'
issue_id, sender_id, assigner_ids = args[0], args[1], args[2]
issue_id, sender_id, changes = args[0], args[1], args[2]
issue = Issue.find_by_id issue_id
sender = User.find_by_id sender_id
return if issue.nil? || sender.nil?
issue.project.webhooks.each do |webhook|
next unless webhook.events["events"]["issue_assign"]
_, _, @webhook_task = Webhook::IssueClient.new(webhook, issue, sender, "issue_assign",{assigner_ids: assigner_ids}.stringify_keys).do_request
_, _, @webhook_task = Webhook::IssueClient.new(webhook, issue, sender, "issue_assign", changes.stringify_keys).do_request
Rails.logger.info "Touch Webhook Response result: #{@webhook_task.response_content}"
end
when 'IssueLabel'
issue_id, sender_id, issue_tag_ids = args[0], args[1], args[2]
issue_id, sender_id, changes = args[0], args[1], args[2]
issue = Issue.find_by_id issue_id
sender = User.find_by_id sender_id
return if issue.nil? || sender.nil?
issue.project.webhooks.each do |webhook|
next unless webhook.events["events"]["issue_label"]
_, _, @webhook_task = Webhook::IssueClient.new(webhook, issue, sender, "issue_label",{issue_tag_ids: issue_tag_ids}.stringify_keys).do_request
_, _, @webhook_task = Webhook::IssueClient.new(webhook, issue, sender, "issue_label", changes.stringify_keys).do_request
Rails.logger.info "Touch Webhook Response result: #{@webhook_task.response_content}"
end