fix: Auto populate team after assigned via API (#5250)
This commit is contained in:
@@ -44,4 +44,11 @@ class Team < ApplicationRecord
|
|||||||
def reporting_events
|
def reporting_events
|
||||||
account.reporting_events.where(conversation_id: conversations.pluck(:id))
|
account.reporting_events.where(conversation_id: conversations.pluck(:id))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def push_event_data
|
||||||
|
{
|
||||||
|
id: id,
|
||||||
|
name: name
|
||||||
|
}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ class Conversations::EventDataPresenter < SimpleDelegator
|
|||||||
{
|
{
|
||||||
sender: contact.push_event_data,
|
sender: contact.push_event_data,
|
||||||
assignee: assignee&.push_event_data,
|
assignee: assignee&.push_event_data,
|
||||||
|
team: team&.push_event_data,
|
||||||
hmac_verified: contact_inbox&.hmac_verified
|
hmac_verified: contact_inbox&.hmac_verified
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -428,6 +428,7 @@ RSpec.describe Conversation, type: :model do
|
|||||||
meta: {
|
meta: {
|
||||||
sender: conversation.contact.push_event_data,
|
sender: conversation.contact.push_event_data,
|
||||||
assignee: conversation.assignee,
|
assignee: conversation.assignee,
|
||||||
|
team: conversation.team,
|
||||||
hmac_verified: conversation.contact_inbox.hmac_verified
|
hmac_verified: conversation.contact_inbox.hmac_verified
|
||||||
},
|
},
|
||||||
id: conversation.display_id,
|
id: conversation.display_id,
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ RSpec.describe Conversations::EventDataPresenter do
|
|||||||
meta: {
|
meta: {
|
||||||
sender: conversation.contact.push_event_data,
|
sender: conversation.contact.push_event_data,
|
||||||
assignee: conversation.assignee,
|
assignee: conversation.assignee,
|
||||||
|
team: conversation.team,
|
||||||
hmac_verified: conversation.contact_inbox.hmac_verified
|
hmac_verified: conversation.contact_inbox.hmac_verified
|
||||||
},
|
},
|
||||||
id: conversation.display_id,
|
id: conversation.display_id,
|
||||||
|
|||||||
Reference in New Issue
Block a user