Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Made unique check to ignore empty values and fixed invalid row update issue #422

Merged
merged 1 commit into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading