Skip to content

Commit

Permalink
[Generic] Dashboard Mapping Resolve: (fix for dashboard mappingResolv…
Browse files Browse the repository at this point in the history
…eStat) (#656)

* fix for dashboard mappingResolveStat

* updated fix
  • Loading branch information
anishfyle authored Mar 12, 2024
1 parent 41004dc commit af9bac4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/app/core/models/db/error.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit af9bac4

Please sign in to comment.