Fixed newsletter used from post in email preview

This commit is contained in:
Simon Backx 2022-05-10 12:21:05 +02:00
parent 651f498f0b
commit 23c1939515

View File

@ -55,10 +55,8 @@ export default class EmailPreviewModal extends Component {
let {html, subject} = this;
// Fetch newsletter
if (!this.newsletter && this.args.data.newsletterId) {
const newsletters = (await this.store.query('newsletter', {filter: 'status:active+id:' + this.args.data.newsletterId, limit: 1})).toArray();
const defaultNewsletter = newsletters[0];
this.newsletter = defaultNewsletter;
if (!this.newsletter && this.args.data.newsletter) {
this.newsletter = this.args.data.newsletter;
}
if (!this.newsletter) {