Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
Enabled fetch members count on post only if members is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabhgrg committed Nov 7, 2019
1 parent 0aecbb7 commit 997b250
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions app/controllers/editor.js
Expand Up @@ -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 --------------------------------------------------------*/
Expand Down

0 comments on commit 997b250

Please sign in to comment.