mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 14:17:22 +01:00
always check for the quantity not (#10251)
This commit is contained in:
@@ -18,15 +18,11 @@ export class AbstractBuyOperation {
|
||||
this.req = req || {};
|
||||
this.analytics = analytics;
|
||||
|
||||
this.quantity = 1;
|
||||
|
||||
if (this.multiplePurchaseAllowed()) {
|
||||
let quantity = _get(req, 'quantity');
|
||||
|
||||
this.quantity = quantity ? Number(quantity) : 1;
|
||||
if (isNaN(this.quantity)) throw new BadRequest(this.i18n('invalidQuantity'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Shortcut to get the translated string without passing `req.language`
|
||||
|
||||
Reference in New Issue
Block a user