mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
adapt reset to v2 and remove deleted files from gulpfile
This commit is contained in:
@@ -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'),
|
||||
};
|
||||
|
||||
if (req.v2 === true) {
|
||||
return user;
|
||||
} else {
|
||||
return response;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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 = [
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user