Chatwoot/app/views/api/v1/accounts/conversations/search.json.jbuilder
Pranav Raj S 399f9e004a
fix: Use last_activity_at instead of updated_at for sorting (#1281)
Co-authored-by: Akash Srivastava <akash.srivastava.1911@gmail.com>
2020-10-05 22:52:43 +05:30

22 lines
845 B
Ruby

json.data do
json.meta do
json.mine_count @conversations_count[:mine_count]
json.unassigned_count @conversations_count[:unassigned_count]
json.all_count @conversations_count[:all_count]
end
json.payload do
json.array! @conversations do |conversation|
json.inbox_id conversation.inbox_id
json.messages conversation.messages
json.status conversation.status
json.muted conversation.muted?
json.can_reply conversation.can_reply?
json.timestamp conversation.last_activity_at.to_i
json.contact_last_seen_at conversation.contact_last_seen_at.to_i
json.agent_last_seen_at conversation.agent_last_seen_at.to_i
json.additional_attributes conversation.additional_attributes
json.account_id conversation.account_id
json.labels conversation.label_list
end
end
end