mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 22:27:26 +01:00
* Moved buy tests * Added mystery buy to buy.js * Added quest purchasing to buy * Added buy special * Moved integration tests to buy folder * Removed buyGear dependency * Removed buyArmoire dependency * Removed buyHealthPotion dependency * Removed myster, quest and special dependency * Replaced functions with factory * Added bulk purchasing to common * Added bulk purchasing to the api * Added bulk purchasing to client * Refactored purchasing function to reduce long method * Added bulk purchase to gem purchases * Added bulk purchasing to api * Added bulk purchasing to gem items on client * Removed bulk from equipment * Removed recentlyPurchased * Fixed style issues and prevented puchasing more gems than are left * Fixed lint * Fixed missing keys * Fixed gem amount notice * Added quest modal to pinned item * Added bulk purchase to gem modal * Fixed styles * Fixed bulk purchase for spells * Fixed modal size * Hid autofill
13 lines
394 B
JavaScript
13 lines
394 B
JavaScript
import buy from './buy';
|
|
import purchaseOp from './purchase';
|
|
import get from 'lodash/get';
|
|
|
|
module.exports = function purchaseWithSpell (user, req = {}, analytics) {
|
|
const type = get(req.params, 'type');
|
|
|
|
// Set up type for buy function - different than the above type.
|
|
req.type = 'special';
|
|
|
|
return type === 'spells' ? buy(user, req, analytics) : purchaseOp(user, req, analytics);
|
|
};
|