mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
Remove unused v2 code from /website/common/script (#8034)
* remove apiv2 behavior from ops * remove apiv2 behavior from fns
This commit is contained in:
committed by
Blade Barringer
parent
8f9ed6e377
commit
5f0c1687b5
@@ -5,7 +5,6 @@ import {
|
||||
BadRequest,
|
||||
NotAuthorized,
|
||||
} from '../libs/errors';
|
||||
import splitWhitespace from '../libs/splitWhitespace';
|
||||
|
||||
module.exports = function purchaseHourglass (user, req = {}, analytics) {
|
||||
let key = _.get(req, 'params.key');
|
||||
@@ -51,12 +50,8 @@ module.exports = function purchaseHourglass (user, req = {}, analytics) {
|
||||
});
|
||||
}
|
||||
|
||||
if (req.v2 === true) {
|
||||
return _.pick(user, splitWhitespace('items purchased.plan.consecutive'));
|
||||
} else {
|
||||
return [
|
||||
{ items: user.items, purchasedPlanConsecutive: user.purchased.plan.consecutive },
|
||||
i18n.t('hourglassPurchase', req.language),
|
||||
];
|
||||
}
|
||||
return [
|
||||
{ items: user.items, purchasedPlanConsecutive: user.purchased.plan.consecutive },
|
||||
i18n.t('hourglassPurchase', req.language),
|
||||
];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user