mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 22:27:26 +01:00
* move to shops/purchase * move files to /buy/ instead of /purchase/ * refactor buy.js - add more itemtypes * revert moving special purchases to buy * only use buyOp from api-routes * fix buying potion client-side * undo import buy instead of purchase * enable potion bulk purchase - use buyGear as fallback (as before) * move quantity purchase inside buyHealthPotion * move quantity purchase inside buyQuest * move quantity purchase inside buySpecialSpell + add analytics * remove unused quantity variable - set req.type on specialKeys * fix `buyKnownKeys` on buy api * test buy-special-spell if not enough gold * more buy ops coverage * fix lint * buyMysterySet: test for window.confirm, buyQuest: check for Masterclassers unlock * fix test & lint * re-create package-lock.json to travis build ? * use global.window instead of method argument * add back canOwn checks * remove buyMysterySet confirm request
13 lines
268 B
JavaScript
13 lines
268 B
JavaScript
import buy from './buy';
|
|
import get from 'lodash/get';
|
|
|
|
module.exports = function purchaseWithSpell (user, req = {}, analytics) {
|
|
const type = get(req.params, 'type');
|
|
|
|
if (type === 'spells') {
|
|
req.type = 'special';
|
|
}
|
|
|
|
return buy(user, req, analytics);
|
|
};
|