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
|
||||
account.reporting_events.where(conversation_id: conversations.pluck(:id))
|
||||
end
|
||||
|
||||
def push_event_data
|
||||
{
|
||||
id: id,
|
||||
name: name
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
|
@ -27,6 +27,7 @@ class Conversations::EventDataPresenter < SimpleDelegator
|
|||
{
|
||||
sender: contact.push_event_data,
|
||||
assignee: assignee&.push_event_data,
|
||||
team: team&.push_event_data,
|
||||
hmac_verified: contact_inbox&.hmac_verified
|
||||
}
|
||||
end
|
||||
|
|
|
@ -428,6 +428,7 @@ RSpec.describe Conversation, type: :model do
|
|||
meta: {
|
||||
sender: conversation.contact.push_event_data,
|
||||
assignee: conversation.assignee,
|
||||
team: conversation.team,
|
||||
hmac_verified: conversation.contact_inbox.hmac_verified
|
||||
},
|
||||
id: conversation.display_id,
|
||||
|
|
|
@ -13,6 +13,7 @@ RSpec.describe Conversations::EventDataPresenter do
|
|||
meta: {
|
||||
sender: conversation.contact.push_event_data,
|
||||
assignee: conversation.assignee,
|
||||
team: conversation.team,
|
||||
hmac_verified: conversation.contact_inbox.hmac_verified
|
||||
},
|
||||
id: conversation.display_id,
|
||||
|
|
Loading…
Reference in a new issue