mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Enabled fetch members count on post only if members is enabled
This commit is contained in:
parent
44819d1fbf
commit
61972b01ce
1 changed files with 10 additions and 8 deletions
|
@ -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);
|
||||
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'));
|
||||
let membersResponse = yield this.store.query('member', {limit: 1});
|
||||
this.set('memberCount', get(membersResponse, 'meta.pagination.total'));
|
||||
}
|
||||
}).restartable(),
|
||||
|
||||
/* Public methods --------------------------------------------------------*/
|
||||
|
|
Loading…
Add table
Reference in a new issue