Skip to content

Commit

Permalink
feat: Made unique check to ignore empty values and fixed invalid ro…
Browse files Browse the repository at this point in the history
…w update issue (#422)
  • Loading branch information
chavda-bhavik authored Nov 24, 2023
2 parents 2ed4775 + fe3fce4 commit a906880
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,9 @@ export class BaseReview {
keyword: 'uniqueCheck',
schema: false, // keyword value is not used, can be true
validate: function (data: any, dataPath: AnySchemaObject) {
if (!String(data)) {
return true;
}
if (uniqueItems[dataPath.parentDataProperty].has(data)) {
return false;
}
Expand Down
1 change: 1 addition & 0 deletions apps/api/src/app/shared/services/sandbox/contents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ function processErrors(batchData, errors) {
let rowIndexToUpdate, combinedErrors, isErrorsEmpty;
errors.forEach(error => {
rowIndexToUpdate = error.index - Math.max(0, ((batchData.batchCount - 1)* input.chunkSize));
rowIndexToUpdate = Math.max(0, rowIndexToUpdate - 1);
if(
rowIndexToUpdate <= batchData.batchCount * input.chunkSize &&
(typeof error.errors === 'object' && !Array.isArray(error.errors) && error.errors !== null)
Expand Down

0 comments on commit a906880

Please sign in to comment.