fix(workflow): add empty array validation for required checklist fields in trigger plugin

The checkValid function was not properly validating required checklist fields when they had empty array values. This caused required fields to pass validation even when no options were selected.

Added array length check to the constant type validation to ensure required checklist fields must have at least one selected option.
This commit is contained in:
lyzno1
2025-10-29 12:36:43 +08:00
parent 0b599b44b0
commit 852d851996

View File

@ -272,7 +272,12 @@ const nodeDefault: NodeDefault<PluginTriggerNodeType> = {
errorMessage = t('workflow.errorMsg.fieldRequired', { field: field.label })
}
else {
if (value === undefined || value === null || value === '')
if (
value === undefined
|| value === null
|| value === ''
|| (Array.isArray(value) && value.length === 0)
)
errorMessage = t('workflow.errorMsg.fieldRequired', { field: field.label })
}
})