diff options
Diffstat (limited to 'models/cards.js')
-rw-r--r-- | models/cards.js | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/models/cards.js b/models/cards.js index 1ee4ba68..94b174bb 100644 --- a/models/cards.js +++ b/models/cards.js @@ -334,8 +334,8 @@ Cards.attachSchema( 'vote.end': { type: Date, optional: true, - defaultValue: null - } + defaultValue: null, + }, }), ); @@ -728,7 +728,7 @@ Cards.helpers({ parentString(sep) { return this.parentList() - .map(function (elem) { + .map(function(elem) { return elem.title; }) .join(sep); @@ -1449,11 +1449,11 @@ Cards.mutations({ $set: { vote: { question, - positive:[], - negative:[] + positive: [], + negative: [], }, - } - } + }, + }; }, unsetVote() { return { @@ -1467,32 +1467,32 @@ Cards.mutations({ case true: // vote for it return { - $pull:{ - "vote.negative": userId + $pull: { + 'vote.negative': userId, }, $addToSet: { - "vote.positive": userId - } - } + 'vote.positive': userId, + }, + }; case false: // vote against return { - $pull:{ - "vote.positive": userId + $pull: { + 'vote.positive': userId, }, $addToSet: { - "vote.negative" : userId - } - } + 'vote.negative': userId, + }, + }; default: // Remove votes return { - $pull:{ - "vote.positive": userId, - "vote.negative" : userId + $pull: { + 'vote.positive': userId, + 'vote.negative': userId, }, - } + }; } }, }); @@ -1897,7 +1897,7 @@ if (Meteor.isServer) { }); //New activity for card moves - Cards.after.update(function (userId, doc, fieldNames) { + Cards.after.update(function(userId, doc, fieldNames) { const oldListId = this.previous.listId; const oldSwimlaneId = this.previous.swimlaneId; const oldBoardId = this.previous.boardId; @@ -1943,7 +1943,7 @@ if (Meteor.isServer) { // change list modifiedAt, when user modified the key values in timingaction array, if it's endAt, put the modifiedAt of list back to one year ago for sorting purpose const modifiedAt = new Date( new Date(value).getTime() - - (action === 'endAt' ? 365 * 24 * 3600 * 1e3 : 0), + (action === 'endAt' ? 365 * 24 * 3600 * 1e3 : 0), ); // set it as 1 year before const boardId = list.boardId; Lists.direct.update( @@ -1997,7 +1997,7 @@ if (Meteor.isServer) { JsonRoutes.add( 'GET', '/api/boards/:boardId/swimlanes/:swimlaneId/cards', - function (req, res) { + function(req, res) { const paramBoardId = req.params.boardId; const paramSwimlaneId = req.params.swimlaneId; Authentication.checkBoardAccess(req.userId, paramBoardId); @@ -2007,7 +2007,7 @@ if (Meteor.isServer) { boardId: paramBoardId, swimlaneId: paramSwimlaneId, archived: false, - }).map(function (doc) { + }).map(function(doc) { return { _id: doc._id, title: doc.title, @@ -2031,7 +2031,7 @@ if (Meteor.isServer) { * title: string, * description: string}] */ - JsonRoutes.add('GET', '/api/boards/:boardId/lists/:listId/cards', function ( + JsonRoutes.add('GET', '/api/boards/:boardId/lists/:listId/cards', function( req, res, ) { @@ -2044,7 +2044,7 @@ if (Meteor.isServer) { boardId: paramBoardId, listId: paramListId, archived: false, - }).map(function (doc) { + }).map(function(doc) { return { _id: doc._id, title: doc.title, @@ -2066,7 +2066,7 @@ if (Meteor.isServer) { JsonRoutes.add( 'GET', '/api/boards/:boardId/lists/:listId/cards/:cardId', - function (req, res) { + function(req, res) { const paramBoardId = req.params.boardId; const paramListId = req.params.listId; const paramCardId = req.params.cardId; @@ -2098,7 +2098,7 @@ if (Meteor.isServer) { * @param {string} [assignees] the array of maximum one ID of assignee of the new card * @return_type {_id: string} */ - JsonRoutes.add('POST', '/api/boards/:boardId/lists/:listId/cards', function ( + JsonRoutes.add('POST', '/api/boards/:boardId/lists/:listId/cards', function( req, res, ) { @@ -2205,7 +2205,7 @@ if (Meteor.isServer) { JsonRoutes.add( 'PUT', '/api/boards/:boardId/lists/:listId/cards/:cardId', - function (req, res) { + function(req, res) { Authentication.checkUserId(req.userId); const paramBoardId = req.params.boardId; const paramCardId = req.params.cardId; @@ -2504,7 +2504,7 @@ if (Meteor.isServer) { JsonRoutes.add( 'DELETE', '/api/boards/:boardId/lists/:listId/cards/:cardId', - function (req, res) { + function(req, res) { Authentication.checkUserId(req.userId); const paramBoardId = req.params.boardId; const paramListId = req.params.listId; |