Allow saving form also when list selection with lists is present
[MAILPOET-2828]
This commit is contained in:
committed by
Veljko V
parent
bef9267593
commit
201c1c7656
@@ -7,8 +7,12 @@ export default (formData, formBlocks) => {
|
||||
if (!Array.isArray(formBlocks)) {
|
||||
throw new Error('formBlocks are expected to be an array.');
|
||||
}
|
||||
const customSegmentsBlock = findBlock(formBlocks, 'mailpoet-form/segment-select');
|
||||
const errors = [];
|
||||
if (!formData.settings.segments || formData.settings.segments.length === 0) {
|
||||
if (
|
||||
(!customSegmentsBlock || customSegmentsBlock.attributes.values.length === 0)
|
||||
&& (!formData.settings.segments || formData.settings.segments.length === 0)
|
||||
) {
|
||||
errors.push('missing-lists');
|
||||
}
|
||||
const emailInput = findBlock(formBlocks, 'mailpoet-form/email-input');
|
||||
|
Reference in New Issue
Block a user