[MAILPOET-1263] Fixed inconsistency in type of body property on newsletter json after saving and little bit more strict validation check

This commit is contained in:
Rostislav Wolny
2018-02-13 22:15:24 +01:00
parent 9d4f996a6a
commit b7704c90e8

View File

@@ -61,6 +61,9 @@ define([
});
}
}
if (!_.isUndefined(json.body)) {
json.body = JSON.parse(json.body);
}
App.getChannel().trigger('afterEditorSave', json, response);
}).fail(function (response) {
// TODO: Handle saving errors
@@ -306,7 +309,7 @@ define([
}
if ((App.getNewsletter().get('type') === 'notification') &&
contents.indexOf('automatedLatestContent') < 0
contents.indexOf('"type":"automatedLatestContent"') < 0
) {
this.showValidationError(MailPoet.I18n.t('automatedLatestContentMissing'));
return;