mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +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
@@ -1,4 +1,3 @@
|
||||
import splitWhitespace from '../libs/splitWhitespace';
|
||||
import _ from 'lodash';
|
||||
import i18n from '../i18n';
|
||||
import {
|
||||
@@ -21,12 +20,8 @@ module.exports = function readCard (user, req = {}) {
|
||||
user.items.special[`${cardType}Received`].shift();
|
||||
user.flags.cardReceived = false;
|
||||
|
||||
if (req.v2 === true) {
|
||||
return _.pick(user, splitWhitespace('items.special flags.cardReceived'));
|
||||
} else {
|
||||
return [
|
||||
{ specialItems: user.items.special, cardReceived: user.flags.cardReceived },
|
||||
i18n.t('readCard', {cardType}, req.language),
|
||||
];
|
||||
}
|
||||
return [
|
||||
{ specialItems: user.items.special, cardReceived: user.flags.cardReceived },
|
||||
i18n.t('readCard', {cardType}, req.language),
|
||||
];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user