always check for the quantity not (#10251)

This commit is contained in:
negue
2018-04-13 21:04:08 +02:00
committed by Matteo Pagliazzi
parent 5da87640e4
commit 6c4c5b4697

View File

@@ -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'));
}
/**