Fixed member count for limit checks when publishing sometimes being incorrect (#16667)

no issue

- the members stats service was being used for the total member count
when checking member limits for publishing but the stats service is not
always correct which could result in publishing being blocked
unexpectedly
- switched to using the total count from a `/members/` query which
should always be correct/match other counts within the UI
This commit is contained in:
Kevin Ansfield 2023-04-18 16:32:34 +01:00 committed by GitHub
parent 2738d25cc6
commit 59c6f9d28a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -93,9 +93,10 @@ export default class LimitsService extends Service {
}
async getMembersCount() {
const counts = await this.membersStats.fetchCounts();
const members = await this.store.query('member', {limit: 'all'});
const total = members.meta.pagination.total;
return counts.total;
return total;
}
async getNewslettersCount() {