From af9bac4a21cdc0610a0c4434005fc0b20c30bc1d Mon Sep 17 00:00:00 2001 From: Anish Kr Singh <116036738+anishfyle@users.noreply.github.com> Date: Tue, 12 Mar 2024 16:05:42 +0530 Subject: [PATCH] [Generic] Dashboard Mapping Resolve: (fix for dashboard mappingResolveStat) (#656) * fix for dashboard mappingResolveStat * updated fix --- src/app/core/models/db/error.model.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app/core/models/db/error.model.ts b/src/app/core/models/db/error.model.ts index cd7af2833..7a6526853 100644 --- a/src/app/core/models/db/error.model.ts +++ b/src/app/core/models/db/error.model.ts @@ -50,7 +50,12 @@ export type AccountingGroupedErrorStat = { export class ErrorModel { static formatErrors(errors: Error[]): AccountingGroupedErrors { return errors.reduce((groupedErrors: AccountingGroupedErrors, error: Error) => { - const errorType = error.type === AccountingErrorType.EMPLOYEE_MAPPING || AccountingErrorType.CATEGORY_MAPPING ? error.type : AccountingErrorType.ACCOUNTING_ERROR; + let errorType; + if (error.type === AccountingErrorType.EMPLOYEE_MAPPING || error.type === AccountingErrorType.CATEGORY_MAPPING) { + errorType = error.type + } else { + errorType = AccountingErrorType.ACCOUNTING_ERROR; + } const group: Error[] = groupedErrors[errorType] || []; group.push(error); groupedErrors[error.type] = group;