mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
Fixed linting and some tests
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user