summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
Diffstat (limited to 'models')
-rw-r--r--models/boards.js4
-rw-r--r--models/lists.js13
2 files changed, 17 insertions, 0 deletions
diff --git a/models/boards.js b/models/boards.js
index 7328899e..c17c7351 100644
--- a/models/boards.js
+++ b/models/boards.js
@@ -470,6 +470,10 @@ Boards.helpers({
if (excludeLinked) {
query.linkedId = null;
}
+ if (this.isTemplatesBoard()) {
+ query.type = 'template-card';
+ query.archived = false;
+ }
const projection = { limit: 10, sort: { createdAt: -1 } };
if (term) {
diff --git a/models/lists.js b/models/lists.js
index a0b882bc..236432cc 100644
--- a/models/lists.js
+++ b/models/lists.js
@@ -195,10 +195,23 @@ Lists.mutations({
},
archive() {
+ Cards.find({
+ listId: this._id,
+ archived: false,
+ }).forEach((card) => {
+ return card.archive();
+ });
return { $set: { archived: true } };
},
restore() {
+ cardsToRestore = Cards.find({
+ listId: this._id,
+ archived: true,
+ });
+ cardsToRestore.forEach((card) => {
+ card.restore();
+ });
return { $set: { archived: false } };
},