fix: unattended count mismatch in report and list (#7263)

This commit is contained in:
Shivam Mishra
2023-06-08 17:58:13 +05:30
committed by GitHub
parent 2b7989f52b
commit 2f2ae88cba
3 changed files with 3 additions and 3 deletions

View File

@@ -96,10 +96,9 @@ class V2::ReportBuilder
def conversations
@open_conversations = scope.conversations.where(account_id: @account.id).open
first_response_count = @account.reporting_events.where(name: 'first_response', conversation_id: @open_conversations.pluck('id')).count
metric = {
open: @open_conversations.count,
unattended: @open_conversations.count - first_response_count
unattended: @open_conversations.unattended.count
}
metric[:unassigned] = @open_conversations.unassigned.count if params[:type].equal?(:account)
metric