This reverts commit f28533bc47.
This commit is contained in:
@@ -155,9 +155,9 @@ class ConversationFinder
|
|||||||
end
|
end
|
||||||
|
|
||||||
def conversations
|
def conversations
|
||||||
@conversations = @conversations.includes(:taggings, :inbox,
|
@conversations = @conversations.includes(
|
||||||
{ assignee: [{ account_users: [:account] }, { avatar_attachment: [:blob] }] },
|
:taggings, :inbox, { assignee: { avatar_attachment: [:blob] } }, { contact: { avatar_attachment: [:blob] } }, :team, :contact_inbox
|
||||||
{ contact: { avatar_attachment: [:blob] } }, :team, :contact_inbox, :messages)
|
)
|
||||||
sort_by = SORT_OPTIONS[params[:sort_by]] || SORT_OPTIONS['latest']
|
sort_by = SORT_OPTIONS[params[:sort_by]] || SORT_OPTIONS['latest']
|
||||||
@conversations.send(sort_by).page(current_page)
|
@conversations.send(sort_by).page(current_page)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ if conversation.messages.first.blank?
|
|||||||
elsif conversation.unread_incoming_messages.count.zero?
|
elsif conversation.unread_incoming_messages.count.zero?
|
||||||
json.messages [conversation.messages.includes([{ attachments: [{ file_attachment: [:blob] }] }]).last.try(:push_event_data)]
|
json.messages [conversation.messages.includes([{ attachments: [{ file_attachment: [:blob] }] }]).last.try(:push_event_data)]
|
||||||
else
|
else
|
||||||
json.messages conversation.unread_messages.includes([{ attachments: [{ file_attachment: [:blob] }] }]).last(10).map(&:push_event_data)
|
json.messages conversation.unread_messages.includes([:user, { attachments: [{ file_attachment: [:blob] }] }]).last(10).map(&:push_event_data)
|
||||||
end
|
end
|
||||||
|
|
||||||
json.account_id conversation.account_id
|
json.account_id conversation.account_id
|
||||||
|
|||||||
Reference in New Issue
Block a user