From 4c50b40682cf2c6f8b7363de227dd7d4b0fe8191 Mon Sep 17 00:00:00 2001 From: Bill Randall Date: Wed, 25 Oct 2023 12:11:29 -0400 Subject: [PATCH] Display the debug message from the server --- .../productConfigForm/productConfigForm.component.js | 3 +++ .../productConfigForm/productConfigForm.tpl.html | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/src/app/productConfig/productConfigForm/productConfigForm.component.js b/src/app/productConfig/productConfigForm/productConfigForm.component.js index fc4aab92b..0b0f53436 100644 --- a/src/app/productConfig/productConfigForm/productConfigForm.component.js +++ b/src/app/productConfig/productConfigForm/productConfigForm.component.js @@ -339,6 +339,9 @@ 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'] + this.onStateChange({ state: 'errorSubmitting' }) } else { this.errorSavingGeneric = true this.$log.error('Error adding or updating item in cart', error) diff --git a/src/app/productConfig/productConfigForm/productConfigForm.tpl.html b/src/app/productConfig/productConfigForm/productConfigForm.tpl.html index f8fa7b430..bc9c4d9af 100644 --- a/src/app/productConfig/productConfigForm/productConfigForm.tpl.html +++ b/src/app/productConfig/productConfigForm/productConfigForm.tpl.html @@ -57,6 +57,10 @@

{{'ADDING_CART_ERROR'}}

+ +