fix(useDynamicData): throw error when dependency is undefined

This commit is contained in:
Ali BARIN
2022-10-19 20:32:08 +02:00
parent f3f4ea5b60
commit 91ec19c7df

View File

@@ -20,7 +20,7 @@ function computeArguments(args: IFieldDropdownSource["arguments"], getValues: Us
const sanitizedFieldPath = value.replace(/{|}/g, '');
const computedValue = getValues(sanitizedFieldPath);
if (!computedValue) throw new Error(`The ${sanitizedFieldPath} field is required.`);
if (computedValue === undefined) throw new Error(`The ${sanitizedFieldPath} field is required.`);
set(result, name, computedValue);