feat(perf): improve performance of conversation filter API [CW-1605] (#7120)
* feat(perf): don't use count * feat(perf): include messages in the conversation query * feat: include contact inboxes * refactor: use blank?
This commit is contained in:
@@ -17,7 +17,7 @@ json.meta do
|
||||
end
|
||||
|
||||
json.id conversation.display_id
|
||||
if conversation.messages.count.zero?
|
||||
if conversation.messages.first.blank?
|
||||
json.messages []
|
||||
elsif conversation.unread_incoming_messages.count.zero?
|
||||
json.messages [conversation.messages.includes([{ attachments: [{ file_attachment: [:blob] }] }]).last.try(:push_event_data)]
|
||||
|
||||
Reference in New Issue
Block a user