fix: remove repeat message
This commit is contained in:
parent
3a22ece871
commit
be5b3864cd
|
@ -146,7 +146,7 @@ class SendTemplateMessageJob < ApplicationJob
|
||||||
user = User.find_by_id(user_id)
|
user = User.find_by_id(user_id)
|
||||||
project = Project.find_by_id(project_id)
|
project = Project.find_by_id(project_id)
|
||||||
return unless operator.present? && user.present? && project.present?
|
return unless operator.present? && user.present? && project.present?
|
||||||
receivers = project&.all_managers.where.not(id: operator&.id)
|
receivers = project&.all_managers.where.not(id: [operator&.id, user&.id])
|
||||||
receivers_string, content, notification_url = MessageTemplate::ProjectMemberJoined.get_message_content(receivers, user, project)
|
receivers_string, content, notification_url = MessageTemplate::ProjectMemberJoined.get_message_content(receivers, user, project)
|
||||||
Notice::Write::CreateService.call(receivers_string, content, notification_url, source, {operator_id: operator.id, user_id: user.id, project_id: project.id})
|
Notice::Write::CreateService.call(receivers_string, content, notification_url, source, {operator_id: operator.id, user_id: user.id, project_id: project.id})
|
||||||
receivers.find_each do |receiver|
|
receivers.find_each do |receiver|
|
||||||
|
@ -159,7 +159,7 @@ class SendTemplateMessageJob < ApplicationJob
|
||||||
user = User.find_by_id(user_id)
|
user = User.find_by_id(user_id)
|
||||||
project = Project.find_by_id(project_id)
|
project = Project.find_by_id(project_id)
|
||||||
return unless operator.present? && user.present? && project.present?
|
return unless operator.present? && user.present? && project.present?
|
||||||
receivers = project&.all_managers.where.not(id: operator&.id)
|
receivers = project&.all_managers.where.not(id: [operator&.id, user&.id])
|
||||||
receivers_string, content, notification_url = MessageTemplate::ProjectMemberLeft.get_message_content(receivers, user, project)
|
receivers_string, content, notification_url = MessageTemplate::ProjectMemberLeft.get_message_content(receivers, user, project)
|
||||||
Notice::Write::CreateService.call(receivers_string, content, notification_url, source, {operator_id: operator.id, user_id: user.id, project_id: project.id})
|
Notice::Write::CreateService.call(receivers_string, content, notification_url, source, {operator_id: operator.id, user_id: user.id, project_id: project.id})
|
||||||
receivers.find_each do |receiver|
|
receivers.find_each do |receiver|
|
||||||
|
|
Loading…
Reference in New Issue