mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
remove all changes from eslint --fix
This commit is contained in:
@@ -1,30 +1,30 @@
|
||||
import i18n from '../i18n';
|
||||
import preenTodos from '../libs/preenTodos';
|
||||
|
||||
module.exports = function (user, req, cb) {
|
||||
module.exports = function(user, req, cb) {
|
||||
var from, id, movedTask, preenedTasks, ref, task, tasks, to;
|
||||
id = req.params.id;
|
||||
ref = req.query, to = ref.to, from = ref.from;
|
||||
task = user.tasks[id];
|
||||
if (!task) {
|
||||
return typeof cb === 'function' ? cb({
|
||||
return typeof cb === "function" ? cb({
|
||||
code: 404,
|
||||
message: i18n.t('messageTaskNotFound', req.language)
|
||||
}) : void 0;
|
||||
}
|
||||
if (!((to !== null) && (from !== null))) {
|
||||
return typeof cb === 'function' ? cb('?to=__&from=__ are required') : void 0;
|
||||
if (!((to != null) && (from != null))) {
|
||||
return typeof cb === "function" ? cb('?to=__&from=__ are required') : void 0;
|
||||
}
|
||||
tasks = user[task.type + 's'];
|
||||
tasks = user[task.type + "s"];
|
||||
if (task.type === 'todo' && tasks[from] !== task) {
|
||||
preenedTasks = preenTodos(tasks);
|
||||
preenedTasks = api.preenTodos(tasks);
|
||||
if (to !== -1) {
|
||||
to = tasks.indexOf(preenedTasks[to]);
|
||||
}
|
||||
from = tasks.indexOf(preenedTasks[from]);
|
||||
}
|
||||
if (tasks[from] !== task) {
|
||||
return typeof cb === 'function' ? cb({
|
||||
return typeof cb === "function" ? cb({
|
||||
code: 404,
|
||||
message: i18n.t('messageTaskNotFound', req.language)
|
||||
}) : void 0;
|
||||
@@ -35,5 +35,5 @@ module.exports = function (user, req, cb) {
|
||||
} else {
|
||||
tasks.splice(to, 0, movedTask);
|
||||
}
|
||||
return typeof cb === 'function' ? cb(null, tasks) : void 0;
|
||||
return typeof cb === "function" ? cb(null, tasks) : void 0;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user