2024-04-15 19:39:03 +02:00
|
|
|
import FormPropertyLogicRule from "~/lib/forms/FormPropertyLogicRule.js"
|
2023-12-20 16:10:32 +01:00
|
|
|
|
|
|
|
|
export const validatePropertiesLogic = (properties) => {
|
|
|
|
|
properties.forEach((field) => {
|
2024-04-15 19:39:03 +02:00
|
|
|
const isValid = new FormPropertyLogicRule(field).isValid()
|
2023-12-20 16:10:32 +01:00
|
|
|
if (!isValid) {
|
|
|
|
|
field.logic = {
|
|
|
|
|
conditions: null,
|
2024-04-15 19:39:03 +02:00
|
|
|
actions: [],
|
2023-12-20 16:10:32 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
return properties
|
|
|
|
|
}
|