mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-05-25 15:15:52 +00:00
always check for the quantity not (#10251)
This commit is contained in:
parent
5da87640e4
commit
6c4c5b4697
1 changed files with 3 additions and 7 deletions
|
|
@ -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'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue