Explorar o código

Take archived status into consideration for subtasks

Nicu Tofan %!s(int64=7) %!d(string=hai) anos
pai
achega
6ab1cbb341
Modificáronse 1 ficheiros con 18 adicións e 3 borrados
  1. 18 3
      models/cards.js

+ 18 - 3
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() {