From 6ab1cbb341da44cbaffc296ea177a8cd146e5244 Mon Sep 17 00:00:00 2001 From: Nicu Tofan Date: Sat, 23 Jun 2018 23:31:44 +0300 Subject: Take archived status into consideration for subtasks --- models/cards.js | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'models/cards.js') diff --git a/models/cards.js b/models/cards.js index 8cf0ef65..ca0e16be 100644 --- a/models/cards.js +++ b/models/cards.js @@ -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() { -- cgit v1.2.3-1-g7c22