fix: Auto populate team after assigned via API (#5250)
This commit is contained in:
parent
831a3bcd50
commit
2397326324
4 changed files with 10 additions and 0 deletions
|
@ -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,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue