2021-10-20 12:44:56 +00:00
|
|
|
json.id conversation.display_id
|
|
|
|
json.created_at conversation.created_at.to_i
|
|
|
|
json.contact do
|
|
|
|
json.id conversation.contact.id
|
|
|
|
json.name conversation.contact.name
|
|
|
|
end
|
|
|
|
json.inbox do
|
|
|
|
json.id conversation.inbox.id
|
|
|
|
json.name conversation.inbox.name
|
|
|
|
json.channel_type conversation.inbox.channel_type
|
|
|
|
end
|
|
|
|
json.messages do
|
2022-12-05 16:08:12 +00:00
|
|
|
json.array! conversation.messages.last(1) do |message|
|
2021-10-20 12:44:56 +00:00
|
|
|
json.content message.content
|
|
|
|
json.id message.id
|
|
|
|
json.sender_name message.sender.name if message.sender
|
|
|
|
json.message_type message.message_type_before_type_cast
|
|
|
|
json.created_at message.created_at.to_i
|
|
|
|
end
|
|
|
|
end
|
|
|
|
json.account_id conversation.account_id
|