fix: show the unique row value in the import preview

This commit is contained in:
Ahmed Bouhuolia
2024-03-28 05:38:24 +02:00
parent 8ab809fc71
commit 040f016273
10 changed files with 70 additions and 40 deletions

View File

@@ -97,9 +97,11 @@ export class CommandAccountValidators {
query.whereNot('id', notAccountId);
}
});
if (account.length > 0) {
throw new ServiceError(ERRORS.ACCOUNT_CODE_NOT_UNIQUE);
throw new ServiceError(
ERRORS.ACCOUNT_CODE_NOT_UNIQUE,
'Account code is not unique.'
);
}
}
@@ -124,7 +126,10 @@ export class CommandAccountValidators {
}
});
if (foundAccount) {
throw new ServiceError(ERRORS.ACCOUNT_NAME_NOT_UNIQUE);
throw new ServiceError(
ERRORS.ACCOUNT_NAME_NOT_UNIQUE,
'Account name is not unique.'
);
}
}