Skip to content

Commit

Permalink
FIO-9321 updated sync method
Browse files Browse the repository at this point in the history
  • Loading branch information
HannaKurban committed Nov 25, 2024
1 parent bd6d7d4 commit 0719a30
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/process/validation/rules/validateAvailableItems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,17 @@ export const validateAvailableItemsSync: RuleFnSync = (context: ValidationContex
}
return values.find((optionValue) => optionValue === value) !== undefined ? null : error;
}
} else if (isValidateableSelectBoxesComponent(component) && component.dataSrc !== 'url') {
if (value == null || isEmpty(value) || !isObject(value)) {
return null;
}

const values = component.values.map(val => val.value);
if (values) {
return difference(Object.keys(value), values).length
? error
: null;
}
}
} catch (err: any) {
throw new ProcessorError(err.message || err, context, 'validate:validateAvailableItems');
Expand Down

0 comments on commit 0719a30

Please sign in to comment.