Fixed linting and some tests
This commit is contained in:
@@ -147,7 +147,7 @@ import deletePM from './ops/deletePM';
|
||||
import reroll from './ops/reroll';
|
||||
import addPushDevice from './ops/addPushDevice';
|
||||
import reset from './ops/reset';
|
||||
import markPmsRead from './ops/markPmsRead';
|
||||
import markPmsRead from './ops/markPMSRead';
|
||||
|
||||
api.ops = {
|
||||
scoreTask,
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user