From b2fee6a6c196f2ed2788444ad2387fba8f6df9cb Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Sun, 24 May 2020 12:37:54 +0200 Subject: Use an arrow function inside forEach() instead of an anonymous function Suggested by deepcode.ai. --- models/checklists.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'models') diff --git a/models/checklists.js b/models/checklists.js index cf73e500..62c71d5f 100644 --- a/models/checklists.js +++ b/models/checklists.js @@ -100,13 +100,13 @@ Checklists.helpers({ }, checkAllItems() { const checkItems = ChecklistItems.find({ checklistId: this._id }); - checkItems.forEach(function(item) { + checkItems.forEach(item => { item.check(); }); }, uncheckAllItems() { const checkItems = ChecklistItems.find({ checklistId: this._id }); - checkItems.forEach(function(item) { + checkItems.forEach(item => { item.uncheck(); }); }, @@ -307,7 +307,7 @@ if (Meteor.isServer) { items = [items]; } } - items.forEach(function(item, idx) { + items.forEach((item, idx) => { ChecklistItems.insert({ cardId: paramCardId, checklistId: id, -- cgit v1.2.3-1-g7c22 From 6e088af3d13b3b5912b783b485681bbd44ea4427 Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Sun, 24 May 2020 13:01:18 +0200 Subject: Fix email verification in `sendSMTPTestEmail` Found by deepcode.ai. --- models/settings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'models') diff --git a/models/settings.js b/models/settings.js index fb823205..b665642e 100644 --- a/models/settings.js +++ b/models/settings.js @@ -259,7 +259,7 @@ if (Meteor.isServer) { throw new Meteor.Error('invalid-user'); } const user = Meteor.user(); - if (!user.emails && !user.emails[0] && user.emails[0].address) { + if (!user.emails || !user.emails[0] || user.emails[0].address) { throw new Meteor.Error('email-invalid'); } this.unblock(); -- cgit v1.2.3-1-g7c22