summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
Diffstat (limited to 'models')
-rw-r--r--models/cards.js41
1 files changed, 33 insertions, 8 deletions
diff --git a/models/cards.js b/models/cards.js
index 710b9d85..9a715ca3 100644
--- a/models/cards.js
+++ b/models/cards.js
@@ -204,7 +204,11 @@ Cards.helpers({
},
checklists() {
- return Checklists.find({cardId: this._id}, {sort: { sort: 1 } });
+ if (this.isImportedCard()) {
+ return Checklists.find({cardId: this.importedId}, {sort: { sort: 1 } });
+ } else {
+ return Checklists.find({cardId: this._id}, {sort: { sort: 1 } });
+ }
},
checklistItemCount() {
@@ -414,7 +418,10 @@ Cards.helpers({
const board = Boards.findOne({_id: this.importedId});
return Boards.update({_id: this.importedId}, {$set: {description}});
} else {
- return {$set: {description}};
+ return Cards.update(
+ {_id: this._id},
+ {$set: {description}}
+ );
}
},
@@ -511,7 +518,10 @@ Cards.helpers({
{$set: {receivedAt}}
);
} else {
- return {$set: {receivedAt}};
+ return Cards.update(
+ {_id: this._id},
+ {$set: {receivedAt}}
+ );
}
},
@@ -539,7 +549,10 @@ Cards.helpers({
{$set: {startAt}}
);
} else {
- return {$set: {startAt}};
+ return Cards.update(
+ {_id: this._id},
+ {$set: {startAt}}
+ );
}
},
@@ -567,7 +580,10 @@ Cards.helpers({
{$set: {dueAt}}
);
} else {
- return {$set: {dueAt}};
+ return Cards.update(
+ {_id: this._id},
+ {$set: {dueAt}}
+ );
}
},
@@ -595,7 +611,10 @@ Cards.helpers({
{$set: {endAt}}
);
} else {
- return {$set: {endAt}};
+ return Cards.update(
+ {_id: this._id},
+ {$set: {endAt}}
+ );
}
},
@@ -623,7 +642,10 @@ Cards.helpers({
{$set: {isOvertime}}
);
} else {
- return {$set: {isOvertime}};
+ return Cards.update(
+ {_id: this._id},
+ {$set: {isOvertime}}
+ );
}
},
@@ -651,7 +673,10 @@ Cards.helpers({
{$set: {spentTime}}
);
} else {
- return {$set: {spentTime}};
+ return Cards.update(
+ {_id: this._id},
+ {$set: {spentTime}}
+ );
}
},
});