🐛 fix(reactflowUtils.ts): improve error message for empty key in validateNode function

This commit is contained in:
Cristhian Zanforlin Lousa 2023-09-18 22:32:11 -03:00
commit a6c80a8780

View file

@ -229,7 +229,7 @@ export function validateNode(
template[t].value !== "") template[t].value !== "")
) { ) {
if (hasDuplicateKeys(template[t].value)) errors.push(`${type} (${template.display_name || template[t].name}) contains duplicate keys with the same values.`); if (hasDuplicateKeys(template[t].value)) errors.push(`${type} (${template.display_name || template[t].name}) contains duplicate keys with the same values.`);
if (hasEmptyKey(template[t].value)) errors.push(`${type} (${template.display_name || template[t].name}) contains keys with empty values.`); if (hasEmptyKey(template[t].value)) errors.push(`${type} (${template.display_name || template[t].name}) field must not be empty.`);
} }
return errors; return errors;
}, [] as string[]); }, [] as string[]);