Skip to content

Commit

Permalink
Account for other style of error message
Browse files Browse the repository at this point in the history
  • Loading branch information
wrandall22 committed Oct 25, 2023
1 parent 9986355 commit e17d9c2
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,11 @@ class ProductConfigFormController {
if (includes(error.data, 'already in the cart')) {
this.errorAlreadyInCart = true
this.onStateChange({ state: 'errorAlreadyInCart' })
} else if (error?.data?.messages[0]?.id === 'field.invalid.decimal.format') {
this.amountFormatError = error?.data?.messages[0]['debug-message']
} else if (error.data.messages[0] && error.data.messages[0].id === 'field.invalid.decimal.format') {
this.amountFormatError = error.data.messages[0]['debug-message']
this.onStateChange({ state: 'errorSubmitting' })
} else if (includes(error.data, 'decimal number')) {
this.amountFormatError = error.data
this.onStateChange({ state: 'errorSubmitting' })
} else {
this.errorSavingGeneric = true
Expand Down

0 comments on commit e17d9c2

Please sign in to comment.