summaryrefslogtreecommitdiffstats
path: root/models/cards.js
diff options
context:
space:
mode:
authorAndrés Manelli <andresmanelli@gmail.com>2018-04-18 00:59:22 -0300
committerAndrés Manelli <andresmanelli@gmail.com>2018-08-11 00:07:29 +0200
commit49c415f0239d6645c41881690acfb2a18395fae8 (patch)
tree12ef1e237ec58d15526664a547d2d9a4ebf8d841 /models/cards.js
parentb2e175ba8ceb644e7ddd0a4c74283f1cd0c1c8aa (diff)
downloadwekan-49c415f0239d6645c41881690acfb2a18395fae8.tar.gz
wekan-49c415f0239d6645c41881690acfb2a18395fae8.tar.bz2
wekan-49c415f0239d6645c41881690acfb2a18395fae8.zip
Add two way binding of checklists
Diffstat (limited to 'models/cards.js')
-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}}
+ );
}
},
});