Commit 1c73165c authored by MARCO Jonathan's avatar MARCO Jonathan
Browse files

馃悰 Add the check if the condition is array and the value is a string

parent f1b85f3b
Pipeline #64518 passed with stage
in 14 seconds
......@@ -58,7 +58,7 @@ export const check = (conditions: ConditionTranslated[] | undefined): boolean =>
return conditionsVerified;
}
return false
return false;
};
/**
......@@ -86,25 +86,32 @@ export function fieldCheck(condition: ConditionItemTranslated, conditions: Condi
if (isArray(condition?.value) && isPlainObject(linkedInputValue) && isArray(linkedInputValue?.value)) {
return linkedInputValue.value.some((value: string) => {
return condition.value.includes(value)
})
return condition.value.includes(value);
});
}
if (isArray(condition?.value) && isPlainObject(linkedInputValue) && isString(linkedInputValue?.value)) {
return condition.value.includes(linkedInputValue.value)
return condition.value.includes(linkedInputValue.value);
}
if (isArray(condition?.value) && isString(linkedInputValue)) {
return condition.value.includes(linkedInputValue)
return condition.value.includes(linkedInputValue);
}
if (isString(condition?.value) && isPlainObject(linkedInputValue) && isArray(linkedInputValue?.value)) {
return linkedInputValue.value.some((value: string) => {
return condition.value === value;
});
}
if (isString(condition?.value) && isPlainObject(linkedInputValue) && isString(linkedInputValue?.value)) {
return condition.value === linkedInputValue.value;
}
if (isString(condition?.value)) {
return condition.value === String(linkedInputValue);
}
}
return false
return false;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment