fixed duplicated templates when scheduling/sending same newsletter twice

This commit is contained in:
Amine Ben hammou
2018-01-10 17:37:03 +00:00
parent bfad5509c1
commit cae46d9acd
4 changed files with 54 additions and 4 deletions

View File

@@ -101,6 +101,7 @@ define(
endpoint: 'newsletterTemplates',
action: 'save',
data: {
newsletter_id: response.data.id,
name: response.data.subject,
description: response.data.preheader,
thumbnail: thumbnail.toDataURL('image/jpeg'),
@@ -189,12 +190,17 @@ define(
'MailPoet Free version': window.mailpoet_version,
});
}
this.setState({ loading: false });
});
}).fail(this.showError);
})
.fail((err) => {
this.showError(err);
this.setState({ loading: false });
});
}
})
.fail(this.showError)
.always(() => {
.fail((err) => {
this.showError(err);
this.setState({ loading: false });
});
}