Fixed linting and some tests

This commit is contained in:
Keith Holliday
2016-05-10 10:44:48 -05:00
parent a0939155c9
commit 632a1ebbf3
16 changed files with 64 additions and 42 deletions
+3 -1
View File
@@ -8,7 +8,9 @@ module.exports = function deleteTask (user, req = {}) {
let tid = _.get(req, 'params.id');
let taskType = _.get(req, 'params.taskType');
let index = _.findIndex(user[`${taskType}s`], function(task) {return task._id === tid;});
let index = _.findIndex(user[`${taskType}s`], function findById (task) {
return task._id === tid;
});
if (index === -1) {
throw new NotFound(i18n.t('messageTaskNotFound', req.language));
+1 -1
View File
@@ -46,7 +46,7 @@ import allocate from './allocate';
import readCard from './readCard';
import openMysteryItem from './openMysteryItem';
import scoreTask from './scoreTask';
import markPmsRead from './markPmsRead';
import markPmsRead from './markPMSRead';
module.exports = {
+3 -1
View File
@@ -14,7 +14,9 @@ module.exports = function sortTask (user, req = {}) {
let fromParam = _.get(req, 'query.from');
let taskType = _.get(req, 'params.taskType');
let index = _.findIndex(user[`${taskType}s`], function(task) {return task._id === id;});
let index = _.findIndex(user[`${taskType}s`], function findById (task) {
return task._id === id;
});
if (index === -1) {
throw new NotFound(i18n.t('messageTaskNotFound', req.language));