From b6047ae017f6b07a552a5d249f4d9b0804f9bd1e Mon Sep 17 00:00:00 2001 From: Fabien 'egg' O'Carroll Date: Mon, 15 Feb 2021 12:15:23 +0000 Subject: [PATCH] Updated paid member filters to handle comped status (#1839) refs https://github.com/TryGhost/Ghost/issues/12602 As members can now have a status of 'comped' as well as 'free'/'paid', we need to update queries to the API to function as they were before. --- ghost/admin/app/components/gh-publishmenu.js | 2 +- ghost/admin/app/components/modal-confirm-email-send.js | 2 +- ghost/admin/app/controllers/members.js | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ghost/admin/app/components/gh-publishmenu.js b/ghost/admin/app/components/gh-publishmenu.js index b8b5774ab8..3c9ac1d158 100644 --- a/ghost/admin/app/components/gh-publishmenu.js +++ b/ghost/admin/app/components/gh-publishmenu.js @@ -218,7 +218,7 @@ export default Component.extend({ }), countPaidMembersTask: task(function* () { - const result = yield this.store.query('member', {filter: 'subscribed:true+status:paid', limit: 1, page: 1}); + const result = yield this.store.query('member', {filter: 'subscribed:true+status:-free', limit: 1, page: 1}); const paidMemberCount = result.meta.pagination.total; const freeMemberCount = this.memberCount - paidMemberCount; this.set('paidMemberCount', paidMemberCount); diff --git a/ghost/admin/app/components/modal-confirm-email-send.js b/ghost/admin/app/components/modal-confirm-email-send.js index 5cbb122187..60171f7474 100644 --- a/ghost/admin/app/components/modal-confirm-email-send.js +++ b/ghost/admin/app/components/modal-confirm-email-send.js @@ -22,7 +22,7 @@ export default ModalComponent.extend({ }), countPaidMembersTask: task(function* () { - const result = yield this.store.query('member', {filter: 'subscribed:true+status:paid', limit: 1, page: 1}); + const result = yield this.store.query('member', {filter: 'subscribed:true+status:-free', limit: 1, page: 1}); this.set('paidMemberCount', result.meta.pagination.total); const freeMemberCount = this.model.memberCount - result.meta.pagination.total; this.set('freeMemberCount', freeMemberCount); diff --git a/ghost/admin/app/controllers/members.js b/ghost/admin/app/controllers/members.js index 622709c1e5..8830eaec6e 100644 --- a/ghost/admin/app/controllers/members.js +++ b/ghost/admin/app/controllers/members.js @@ -165,7 +165,7 @@ export default class MembersController extends Controller { let filters = []; if (this.paidParam !== null) { if (this.paidParam === 'true') { - filters.push('status:paid'); + filters.push('status:-free'); } else { filters.push('status:free'); } @@ -292,7 +292,7 @@ export default class MembersController extends Controller { } if (paidParam !== null) { if (paidParam === 'true') { - filters.push('status:paid'); + filters.push('status:-free'); } else { filters.push('status:free'); } @@ -329,7 +329,7 @@ export default class MembersController extends Controller { } if (paidParam !== null) { if (paidParam === 'true') { - filters.push('status:paid'); + filters.push('status:-free'); } else { filters.push('status:free'); }