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