diff options
Diffstat (limited to 'models/cards.js')
-rw-r--r-- | models/cards.js | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/models/cards.js b/models/cards.js index 323ec407..b6a7b4c6 100644 --- a/models/cards.js +++ b/models/cards.js @@ -327,10 +327,14 @@ Cards.helpers({ }, parentCardName() { - if (this.parentId === '') { - return ''; + let result = ''; + if (this.parentId !== '') { + const card = Cards.findOne(this.parentId); + if (card) { + result = card.title; + } } - return Cards.findOne(this.parentId).title; + return result; }, parentListId() { @@ -541,6 +545,11 @@ Cards.mutations({ unsetSpentTime() { return {$unset: {spentTime: '', isOvertime: false}}; }, + + setParentId(parentId) { + return {$set: {parentId}}; + }, + }); |