Take archived status into consideration for subtasks

This commit is contained in:
Nicu Tofan 2018-06-23 23:31:44 +03:00
parent 5a023e4315
commit 6ab1cbb341
No known key found for this signature in database
GPG key ID: 7EE66E95E64FD0B7

View file

@ -221,15 +221,30 @@ Cards.helpers({
},
subtasks() {
return Cards.find({parentId: this._id}, {sort: { sort: 1 } });
return Cards.find({
parentId: this._id,
archived: false,
}, {sort: { sort: 1 } });
},
allSubtasks() {
return Cards.find({
parentId: this._id,
archived: false,
}, {sort: { sort: 1 } });
},
subtasksCount() {
return Cards.find({parentId: this._id}).count();
return Cards.find({
parentId: this._id,
archived: false,
}).count();
},
subtasksFinishedCount() {
return Cards.find({parentId: this._id, archived: true}).count();
return Cards.find({
parentId: this._id,
archived: true}).count();
},
subtasksFinished() {