Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

Updated: the maxValue validator for product quantity selector and updated the variable name to isAboveMax(#566/product-qty-max-value-check) #674

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions components/atoms/a-product-quantity.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
Expand All @@ -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
}
Expand Down