1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00

Enabled fetch members count on post only if members is enabled

This commit is contained in:
Rish 2019-11-07 11:12:48 +07:00
parent 0aecbb7934
commit 997b250fe1

View file

@ -543,14 +543,16 @@ export default Controller.extend({
// load supplementel data such as the actions list in the background
backgroundLoader: task(function* () {
let actions = yield this.store.query('action', {
filter: `resource_type:post+resource_id:${this.post.id}+event:delivered`,
limit: 'all'
});
this.set('actionsList', actions);
let membersResponse = yield this.store.query('member', {limit: 1});
this.set('memberCount', get(membersResponse, 'meta.pagination.total'));
if (this.feature.members) {
let actions = yield this.store.query('action', {
filter: `resource_type:post+resource_id:${this.post.id}+event:delivered`,
limit: 'all'
});
this.set('actionsList', actions);
let membersResponse = yield this.store.query('member', {limit: 1});
this.set('memberCount', get(membersResponse, 'meta.pagination.total'));
}
}).restartable(),
/* Public methods --------------------------------------------------------*/