修复:更改issue评论事件触发逻辑

This commit is contained in:
yystopf 2023-04-11 13:55:25 +08:00
parent afa1cdf842
commit bea2831149
2 changed files with 3 additions and 1 deletions

View File

@ -52,6 +52,7 @@ class TouchWebhookJob < ApplicationJob
comment = issue.comment_journals.find_by_id comment_id
sender = User.find_by_id sender_id
return if issue.nil? || sender.nil?
return if action_type == 'edited' && comment_json.blank?
issue.project.webhooks.each do |webhook|
next unless webhook.events["events"]["issue_comment"]
@ -66,6 +67,7 @@ class TouchWebhookJob < ApplicationJob
sender = User.find_by_id sender_id
pull = issue.try(:pull_request)
return if pull.nil? || sender.nil?
return if action_type == 'edited' && comment_json.blank?
pull.project.webhooks.each do |webhook|
next unless webhook.events["events"]["pull_request_comment"]

View File

@ -38,7 +38,7 @@ class Api::V1::Issues::Journals::UpdateService < ApplicationService
# @信息发送
AtmeService.call(current_user, @atme_receivers, @created_journal) unless receivers_login.blank?
TouchWebhookJob.perform_later('IssueComment', @issue&.id, @current_user.id, @updated_journal.id, 'edited', @updated_journal.previous_changes.stringify_keys)
TouchWebhookJob.perform_later('IssueComment', @issue&.id, @current_user.id, @updated_journal.id, 'edited', @updated_journal.previous_changes.slice(:notes).stringify_keys)
unlock("Api::V1::Issues::Journals::UpdateService:#{@issue.id}:#{@journal.id}")