From 004b032084bdbef4a7cbbd9de73cd8e0f0a9cc4f Mon Sep 17 00:00:00 2001 From: Matteo Pagliazzi Date: Tue, 12 Apr 2016 18:50:02 +0200 Subject: [PATCH] adapt reset to v2 and remove deleted files from gulpfile --- common/script/ops/reset.js | 8 ++++++-- tasks/gulp-eslint.js | 5 ----- website/src/controllers/api-v2/user.js | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/common/script/ops/reset.js b/common/script/ops/reset.js index 525127087d..1e59ccf02a 100644 --- a/common/script/ops/reset.js +++ b/common/script/ops/reset.js @@ -1,7 +1,7 @@ import resetGear from '../fns/resetGear'; import i18n from '../i18n'; -module.exports = function reset (user, tasks = []) { +module.exports = function reset (user, tasks = [], req = {}) { user.stats.hp = 50; user.stats.lvl = 1; user.stats.gp = 0; @@ -24,5 +24,9 @@ module.exports = function reset (user, tasks = []) { message: i18n.t('resetComplete'), }; - return response; + if (req.v2 === true) { + return user; + } else { + return response; + } }; diff --git a/tasks/gulp-eslint.js b/tasks/gulp-eslint.js index 624240b406..9f91a09096 100644 --- a/tasks/gulp-eslint.js +++ b/tasks/gulp-eslint.js @@ -11,11 +11,6 @@ const COMMON_FILES = [ // @TODO remove these negations as the files are converted over. '!./common/script/content/index.js', '!./common/script/fns/randomDrop.js', - '!./common/script/libs/countExists.js', - '!./common/script/libs/encodeiCalLink.js', - '!./common/script/libs/friendlyTimestamp.js', - '!./common/script/libs/newChatMessages.js', - '!./common/script/libs/planGemLimits.js', '!./common/script/public/**/*.js', ]; const TEST_FILES = [ diff --git a/website/src/controllers/api-v2/user.js b/website/src/controllers/api-v2/user.js index 2f343c43f6..6b0bc72acc 100644 --- a/website/src/controllers/api-v2/user.js +++ b/website/src/controllers/api-v2/user.js @@ -878,7 +878,7 @@ _.each(shared.ops, function(op,k){ if (['rebirth', 'reroll', 'reset'].indexOf(k) !== -1) { // proxy ops that change tasks directly to v3 if (k === 'rebirth') k = 'userRebirth'; // the name is different in v3 if (k === 'reroll') k = 'userReroll'; - // if (k === 'reset') k = 'resetUser'; + if (k === 'reset') k = 'userReset'; api[k] = function (req, res, next) { req.v2 = true;