From d4ff9f5b456f7eb61ea69cfc2d0e5cb61cfcb643 Mon Sep 17 00:00:00 2001 From: Sojan Jose Date: Fri, 1 May 2020 16:49:28 +0530 Subject: [PATCH] Chore: Add additional information to conversation meta (#795) Chore: Add additional information to conversation meta --- .../v1/accounts/conversations/messages/index.json.jbuilder | 4 +++- .../api/v1/accounts/conversations/messages_controller_spec.rb | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/api/v1/accounts/conversations/messages/index.json.jbuilder b/app/views/api/v1/accounts/conversations/messages/index.json.jbuilder index 64333d3ec..e04a7dd9c 100644 --- a/app/views/api/v1/accounts/conversations/messages/index.json.jbuilder +++ b/app/views/api/v1/accounts/conversations/messages/index.json.jbuilder @@ -1,7 +1,9 @@ json.meta do json.labels @conversation.label_list json.additional_attributes @conversation.additional_attributes - json.contact_id @conversation.contact_id + json.contact @conversation.contact.push_event_data + json.assignee @conversation.assignee.push_event_data if @conversation.assignee.present? + json.agent_last_seen_at @conversation.agent_last_seen_at end json.payload do diff --git a/spec/controllers/api/v1/accounts/conversations/messages_controller_spec.rb b/spec/controllers/api/v1/accounts/conversations/messages_controller_spec.rb index 6137a7298..7154ef47a 100644 --- a/spec/controllers/api/v1/accounts/conversations/messages_controller_spec.rb +++ b/spec/controllers/api/v1/accounts/conversations/messages_controller_spec.rb @@ -116,7 +116,7 @@ RSpec.describe 'Conversation Messages API', type: :request do as: :json expect(response).to have_http_status(:success) - expect(JSON.parse(response.body, symbolize_names: true)[:meta][:contact_id]).to eq(conversation.contact_id) + expect(JSON.parse(response.body, symbolize_names: true)[:meta][:contact][:id]).to eq(conversation.contact_id) end end end