Progress on deck, dms

This commit is contained in:
mgabdev
2020-12-10 11:51:45 -05:00
parent c35e651b43
commit de0c977950
40 changed files with 660 additions and 274 deletions

View File

@@ -17,9 +17,9 @@ class Api::V1::ChatConversations::ApprovedConversationsController < Api::BaseCon
end
def unread_count
# : todo : make is_unread into unread_count then count
# count = ChatConversationAccount.where(account: current_account, is_hidden: false, is_approved: true, unread_count: true).count
render json: 1
unreads = ChatConversationAccount.where(account: current_account, is_hidden: false, is_approved: true).where('unread_count > 0')
sum = unreads.sum('unread_count')
render json: sum.to_i
end
private