chore: Limit objects returned by conversation API (#2721)

This commit is contained in:
Sojan Jose
2021-07-31 21:19:42 +05:30
committed by GitHub
parent 915366c472
commit 2890339734
15 changed files with 19 additions and 19 deletions

View File

@@ -114,13 +114,13 @@ class ConversationFinder
end
def current_page
params[:page]
params[:page] || 1
end
def conversations
@conversations = @conversations.includes(
:taggings, :inbox, { assignee: { avatar_attachment: [:blob] } }, { contact: { avatar_attachment: [:blob] } }, :team
)
current_page ? @conversations.latest.page(current_page) : @conversations.latest
@conversations.latest.page(current_page)
end
end