From 6c4c5b4697b7147657430e2aeb42a4ff13351619 Mon Sep 17 00:00:00 2001 From: negue Date: Fri, 13 Apr 2018 21:04:08 +0200 Subject: [PATCH] always check for the quantity not (#10251) --- website/common/script/ops/buy/abstractBuyOperation.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/website/common/script/ops/buy/abstractBuyOperation.js b/website/common/script/ops/buy/abstractBuyOperation.js index f325fa7e5b..f4627e2d2d 100644 --- a/website/common/script/ops/buy/abstractBuyOperation.js +++ b/website/common/script/ops/buy/abstractBuyOperation.js @@ -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')); } /**