opnform/client/composables/forms/validatePropertiesLogic.js

15 lines
360 B
JavaScript
Raw Normal View History

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