0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-17 23:44:39 -05:00

Fixed newsletter includes when adding or editing (#2365)

refs https://github.com/TryGhost/Team/issues/1571

- When creating a new newsletter, the counts were not loaded
- When updating a newsletter, the counts were not updated
- Requires https://github.com/TryGhost/Ghost/pull/14696
This commit is contained in:
Simon Backx 2022-05-05 11:31:45 +02:00 committed by GitHub
parent fe4d2aeb9c
commit 93632349b9
3 changed files with 10 additions and 2 deletions

View file

@ -9,6 +9,10 @@ export default class Newsletter extends ApplicationAdapter {
parsedUrl.searchParams.append('opt_in_existing', 'true');
}
if (snapshot?.adapterOptions?.include) {
parsedUrl.searchParams.append('include', snapshot?.adapterOptions?.include);
}
return parsedUrl.toString();
}
}

View file

@ -49,7 +49,11 @@ export default class EditNewsletterModal extends Component {
const newEmail = newsletter.senderEmail;
const result = yield newsletter.save();
const result = yield newsletter.save({
adapterOptions: {
include: 'count.members,count.posts'
}
});
if (result._meta?.sent_email_verification) {
yield this.modals.open(ConfirmNewsletterEmailModal, {

View file

@ -44,7 +44,7 @@ export default class NewNewsletterModal extends Component {
yield newsletter.validate({});
const result = yield newsletter.save({
adapterOptions: {optInExisting: this.optInExisting}
adapterOptions: {optInExisting: this.optInExisting, include: 'count.members,count.posts'}
});
this.args.data.afterSave?.(result);