fix: Auto populate team after assigned via API (#5250)

This commit is contained in:
Tejaswini Chile 2022-08-12 13:40:28 +05:30 committed by GitHub
parent 831a3bcd50
commit 2397326324
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 0 deletions

View file

@ -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

View file

@ -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

View file

@ -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,

View file

@ -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,