fix: send label list not object in event data presenter (#5853)
This commit is contained in:
@@ -24,10 +24,6 @@ class Conversations::EventDataPresenter < SimpleDelegator
|
|||||||
[messages.chat.last&.push_event_data].compact
|
[messages.chat.last&.push_event_data].compact
|
||||||
end
|
end
|
||||||
|
|
||||||
def label_list
|
|
||||||
labels.pluck(:id, :name)
|
|
||||||
end
|
|
||||||
|
|
||||||
def push_meta
|
def push_meta
|
||||||
{
|
{
|
||||||
sender: contact.push_event_data,
|
sender: contact.push_event_data,
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ describe ActionCableListener do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it 'broadcast event with label data' do
|
it 'broadcast event with label data' do
|
||||||
expect(conversation.reload.push_event_data[:labels]).to eq(conversation.labels.pluck(:id, :name))
|
expect(conversation.reload.push_event_data[:labels]).to eq(conversation.labels.pluck(:name))
|
||||||
|
|
||||||
expect(ActionCableBroadcastJob).to receive(:perform_later).with(
|
expect(ActionCableBroadcastJob).to receive(:perform_later).with(
|
||||||
[agent.pubsub_token, admin.pubsub_token, conversation.contact_inbox.pubsub_token],
|
[agent.pubsub_token, admin.pubsub_token, conversation.contact_inbox.pubsub_token],
|
||||||
|
|||||||
Reference in New Issue
Block a user