From d6cfac0122dc5e6819c82f73c728488e0600cb70 Mon Sep 17 00:00:00 2001 From: Ignatz Date: Fri, 18 May 2018 10:24:51 +0200 Subject: linter corrections --- models/cards.js | 17 ++++++++++------- models/customFields.js | 18 +++++++++--------- 2 files changed, 19 insertions(+), 16 deletions(-) (limited to 'models') diff --git a/models/cards.js b/models/cards.js index 8b917ee3..d3a741bb 100644 --- a/models/cards.js +++ b/models/cards.js @@ -51,10 +51,10 @@ Cards.attachSchema(new SimpleSchema({ type: String, }, value: { - type: Match.OneOf(String,Number,Boolean,Date), + type: Match.OneOf(String, Number, Boolean, Date), optional: true, }, - }) + }), }, dateLastActivity: { type: Date, @@ -225,9 +225,9 @@ Cards.helpers({ _id: customField._id, value: customField.value, definition: definitions.find((definition) => { - return definition._id == customField._id; - }) - } + return definition._id === customField._id; + }), + }; }); }, @@ -331,10 +331,13 @@ Cards.mutations({ // todo const index = this.customFieldIndex(customFieldId); if (index > -1) { - var update = {$set: {}}; - update.$set["customFields." + index + ".value"] = value; + const update = {$set: {}}; + update.$set['customFields.${index}.value'] = value; return update; } + // TODO + // Ignatz 18.05.2018: Return null to silence ESLint. No Idea if that is correct + return null; }, setCover(coverId) { diff --git a/models/customFields.js b/models/customFields.js index 57875b6e..6c5fe7c4 100644 --- a/models/customFields.js +++ b/models/customFields.js @@ -9,14 +9,14 @@ CustomFields.attachSchema(new SimpleSchema({ }, type: { type: String, - allowedValues: ['text', 'number', 'date', 'dropdown'] + allowedValues: ['text', 'number', 'date', 'dropdown'], }, settings: { type: Object, }, 'settings.dropdownItems': { type: [Object], - optional: true + optional: true, }, 'settings.dropdownItems.$': { type: new SimpleSchema({ @@ -26,11 +26,11 @@ CustomFields.attachSchema(new SimpleSchema({ name: { type: String, }, - }) + }), }, showOnCard: { type: Boolean, - } + }, })); CustomFields.allow({ @@ -76,16 +76,16 @@ if (Meteor.isServer) { //CUSTOM FIELD REST API if (Meteor.isServer) { - JsonRoutes.add('GET', '/api/boards/:boardId/custom-fields', function (req, res, next) { + JsonRoutes.add('GET', '/api/boards/:boardId/custom-fields', function (req, res) { Authentication.checkUserId( req.userId); const paramBoardId = req.params.boardId; JsonRoutes.sendResult(res, { code: 200, - data: CustomFields.find({ boardId: paramBoardId }) + data: CustomFields.find({ boardId: paramBoardId }), }); }); - JsonRoutes.add('GET', '/api/boards/:boardId/custom-fields/:customFieldId', function (req, res, next) { + JsonRoutes.add('GET', '/api/boards/:boardId/custom-fields/:customFieldId', function (req, res) { Authentication.checkUserId( req.userId); const paramBoardId = req.params.boardId; const paramCustomFieldId = req.params.customFieldId; @@ -95,7 +95,7 @@ if (Meteor.isServer) { }); }); - JsonRoutes.add('POST', '/api/boards/:boardId/custom-fields', function (req, res, next) { + JsonRoutes.add('POST', '/api/boards/:boardId/custom-fields', function (req, res) { Authentication.checkUserId( req.userId); const paramBoardId = req.params.boardId; const id = CustomFields.direct.insert({ @@ -117,7 +117,7 @@ if (Meteor.isServer) { }); }); - JsonRoutes.add('DELETE', '/api/boards/:boardId/custom-fields/:customFieldId', function (req, res, next) { + JsonRoutes.add('DELETE', '/api/boards/:boardId/custom-fields/:customFieldId', function (req, res) { Authentication.checkUserId( req.userId); const paramBoardId = req.params.boardId; const id = req.params.customFieldId; -- cgit v1.2.3-1-g7c22