mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
remove all changes from eslint --fix
This commit is contained in:
@@ -2,22 +2,22 @@ import content from '../content/index';
|
||||
import _ from 'lodash';
|
||||
import splitWhitespace from '../libs/splitWhitespace';
|
||||
|
||||
module.exports = function (user, req, cb) {
|
||||
module.exports = function(user, req, cb) {
|
||||
var key, ref, type;
|
||||
ref = req.params, key = ref.key, type = ref.type;
|
||||
if (type !== 'eggs' && type !== 'hatchingPotions' && type !== 'food') {
|
||||
return typeof cb === 'function' ? cb({
|
||||
return typeof cb === "function" ? cb({
|
||||
code: 404,
|
||||
message: ':type not found. Must bes in [eggs, hatchingPotions, food]'
|
||||
message: ":type not found. Must bes in [eggs, hatchingPotions, food]"
|
||||
}) : void 0;
|
||||
}
|
||||
if (!user.items[type][key]) {
|
||||
return typeof cb === 'function' ? cb({
|
||||
return typeof cb === "function" ? cb({
|
||||
code: 404,
|
||||
message: ':key not found for user.items.' + type
|
||||
message: ":key not found for user.items." + type
|
||||
}) : void 0;
|
||||
}
|
||||
user.items[type][key]--;
|
||||
user.stats.gp += content[type][key].value;
|
||||
return typeof cb === 'function' ? cb(null, _.pick(user, splitWhitespace('stats items'))) : void 0;
|
||||
return typeof cb === "function" ? cb(null, _.pick(user, splitWhitespace('stats items'))) : void 0;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user