From 9c826e031775e32cb0b6e33ff9a4fe21b31cac51 Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Wed, 29 Sep 2021 17:03:23 +0530 Subject: [PATCH] Updated: the maxValue validator for product quantity selector and updated the variable name to isAboveMax(#566/product-qty-max-value-check) --- components/atoms/a-product-quantity.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/atoms/a-product-quantity.vue b/components/atoms/a-product-quantity.vue index 9eb75eeaf..9c2c3ef0a 100644 --- a/components/atoms/a-product-quantity.vue +++ b/components/atoms/a-product-quantity.vue @@ -54,8 +54,8 @@ export default { error () { const isBelowZero = !this.$v.value.numeric || !this.$v.value.minValue || !this.$v.value.required if (isBelowZero) return this.$t(`Quantity must be positive integer`) - const isBelowMax = this.maxQuantity && this.value && !this.$v.value.maxValue - if (isBelowZero) { + const isAboveMax = this.maxQuantity && this.value && !this.$v.value.maxValue + if (isAboveMax) { return this.$t('Quantity must be below {quantity}', { quantity: this.maxQuantity }) @@ -67,7 +67,7 @@ export default { return { value: { minValue: minValue(1), - maxValue: maxValue(this.maxQuantity) && this.unlimitQuantity, + maxValue: maxValue(this.maxQuantity) || this.unlimitQuantity, numeric, required }