mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-15 05:37:22 +01:00
Add special spells to Seasonal Shop API (#8138)
* WIP(shops): add spells to Seasonal API * refactor(shops): remove superfluous if * feat(shops): handle spell purchasing * fix(test): proper required fields check Also corrects a linting error. * refactor(shops): use constants
This commit is contained in:
@@ -832,7 +832,7 @@ api.purchase = {
|
||||
url: '/user/purchase/:type/:key',
|
||||
async handler (req, res) {
|
||||
let user = res.locals.user;
|
||||
let purchaseRes = common.ops.purchase(user, req, res.analytics);
|
||||
let purchaseRes = req.params.type === 'spells' ? common.ops.buySpecialSpell(user, req) : common.ops.purchase(user, req, res.analytics);
|
||||
await user.save();
|
||||
res.respond(200, ...purchaseRes);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user