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,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`