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.
This commit is contained in:
Fabien 'egg' O'Carroll 2021-02-15 12:15:23 +00:00 committed by GitHub
parent f05d353b57
commit b6047ae017
3 changed files with 5 additions and 5 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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');
}