Bladeren bron

Fix lint errors

Andrés Manelli 7 jaren geleden
bovenliggende
commit
fb75a487fc
3 gewijzigde bestanden met toevoegingen van 10 en 13 verwijderingen
  1. 1 1
      client/components/lists/listBody.js
  2. 4 4
      models/boards.js
  3. 5 8
      models/cards.js

+ 1 - 1
client/components/lists/listBody.js

@@ -339,7 +339,7 @@ BlazeComponent.extendComponent({
       listId: this.selectedListId.get(),
       archived: false,
       importedId: null,
-      _id: {$nin: this.board.cards().map((card) => { return card.importedId || card._id})},
+      _id: {$nin: this.board.cards().map((card) => { return card.importedId || card._id; })},
     });
   },
 

+ 4 - 4
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);

+ 5 - 8
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;
     }