diff options
Diffstat (limited to 'models')
-rw-r--r-- | models/boards.js | 8 | ||||
-rw-r--r-- | models/import.js | 19 |
2 files changed, 11 insertions, 16 deletions
diff --git a/models/boards.js b/models/boards.js index 64d6df62..52272cce 100644 --- a/models/boards.js +++ b/models/boards.js @@ -201,6 +201,7 @@ Boards.mutations({ const _id = Random.id(6); return { $push: {labels: { _id, name, color }}}; } + return {}; }, editLabel(labelId, name, color) { @@ -213,6 +214,7 @@ Boards.mutations({ }, }; } + return {}; }, removeLabel(labelId) { @@ -397,8 +399,9 @@ if (Meteor.isServer) { if (!_.contains(fieldNames, 'labels') || !modifier.$pull || !modifier.$pull.labels || - !modifier.$pull.labels._id) + !modifier.$pull.labels._id) { return; + } const removedLabelId = modifier.$pull.labels._id; Cards.update( @@ -414,8 +417,9 @@ if (Meteor.isServer) { // Add a new activity if we add or remove a member to the board Boards.after.update((userId, doc, fieldNames, modifier) => { - if (!_.contains(fieldNames, 'members')) + if (!_.contains(fieldNames, 'members')) { return; + } let memberId; diff --git a/models/import.js b/models/import.js index fecc5c4d..86ef75b3 100644 --- a/models/import.js +++ b/models/import.js @@ -397,8 +397,7 @@ class TrelloCreator { parseActions(trelloActions) { trelloActions.forEach((action) => { - switch (action.type) { - case 'addAttachmentToCard': + if (action.type === 'addAttachmentToCard') { // We have to be cautious, because the attachment could have been removed later. // In that case Trello still reports its addition, but removes its 'url' field. // So we test for that @@ -412,30 +411,22 @@ class TrelloCreator { } this.attachments[trelloCardId].push(trelloAttachment); } - break; - case 'commentCard': + } else if (action.type === 'commentCard') { const id = action.data.card.id; if (this.comments[id]) { this.comments[id].push(action); } else { this.comments[id] = [action]; } - break; - case 'createBoard': + } else if (action.type === 'createBoard') { this.createdAt.board = action.date; - break; - case 'createCard': + } else if (action.type === 'createCard') { const cardId = action.data.card.id; this.createdAt.cards[cardId] = action.date; this.createdBy.cards[cardId] = action.idMemberCreator; - break; - case 'createList': + } else if (action.type === 'createList') { const listId = action.data.list.id; this.createdAt.lists[listId] = action.date; - break; - default: - // do nothing - break; } }); } |