From 0719a304e4a06fce83a63cf73bb4f8d4060c3781 Mon Sep 17 00:00:00 2001 From: Hanna Kurban Date: Mon, 25 Nov 2024 16:46:10 +0300 Subject: [PATCH] FIO-9321 updated sync method --- .../validation/rules/validateAvailableItems.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/process/validation/rules/validateAvailableItems.ts b/src/process/validation/rules/validateAvailableItems.ts index f3e953b0..f6523fff 100644 --- a/src/process/validation/rules/validateAvailableItems.ts +++ b/src/process/validation/rules/validateAvailableItems.ts @@ -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');