diff options
author | Andrés Manelli <andresmanelli@gmail.com> | 2018-04-18 02:37:20 -0300 |
---|---|---|
committer | Andrés Manelli <andresmanelli@gmail.com> | 2018-08-11 00:14:13 +0200 |
commit | fb75a487fcde4f04a371a5ed097ba97cc7134c24 (patch) | |
tree | a0c97dd2ccd950ed974ce602f640775299cb1cf4 /models | |
parent | 37306c8d2244c33aa924de375f2e17f438117d54 (diff) | |
download | wekan-fb75a487fcde4f04a371a5ed097ba97cc7134c24.tar.gz wekan-fb75a487fcde4f04a371a5ed097ba97cc7134c24.tar.bz2 wekan-fb75a487fcde4f04a371a5ed097ba97cc7134c24.zip |
Fix lint errors
Diffstat (limited to 'models')
-rw-r--r-- | models/boards.js | 8 | ||||
-rw-r--r-- | models/cards.js | 13 |
2 files changed, 9 insertions, 12 deletions
diff --git a/models/boards.js b/models/boards.js index a37981e0..e3d82fc9 100644 --- a/models/boards.js +++ b/models/boards.js @@ -323,7 +323,7 @@ Boards.helpers({ searchCards(term, excludeImported) { check(term, Match.OneOf(String, null, undefined)); - let query = { boardId: this._id }; + const query = { boardId: this._id }; if (excludeImported) { query.importedId = null; } @@ -333,9 +333,9 @@ Boards.helpers({ const regex = new RegExp(term, 'i'); query.$or = [ - { title: regex }, - { description: regex }, - ]; + { title: regex }, + { description: regex }, + ]; } return Cards.find(query, projection); diff --git a/models/cards.js b/models/cards.js index c48c5fa1..8e1ffcaa 100644 --- a/models/cards.js +++ b/models/cards.js @@ -426,10 +426,8 @@ Cards.helpers({ setDescription(description) { if (this.isImportedCard()) { - const card = Cards.findOne({_id: this.importedId}); return Cards.update({_id: this.importedId}, {$set: {description}}); } else if (this.isImportedBoard()) { - const board = Boards.findOne({_id: this.importedId}); return Boards.update({_id: this.importedId}, {$set: {description}}); } else { return Cards.update( @@ -452,11 +450,10 @@ Cards.helpers({ return board.description; else return null; + } else if (this.description) { + return this.description; } else { - if (this.description) - return this.description; - else - return null; + return null; } }, @@ -545,7 +542,7 @@ Cards.helpers({ return card.startAt; } else if (this.isImportedBoard()) { const board = Boards.findOne({_id: this.importedId}); - return board.startAt + return board.startAt; } else { return this.startAt; } @@ -576,7 +573,7 @@ Cards.helpers({ return card.dueAt; } else if (this.isImportedBoard()) { const board = Boards.findOne({_id: this.importedId}); - return board.dueAt + return board.dueAt; } else { return this.dueAt; } |