From 673fa95723933de8a8eeeba93505658f63dc0796 Mon Sep 17 00:00:00 2001 From: Maiia Diachkovskaia Date: Fri, 7 Jul 2023 12:43:47 +0900 Subject: [PATCH] fix: quote form validation (#630) --- client-app/pages/account/edit-quote.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/client-app/pages/account/edit-quote.vue b/client-app/pages/account/edit-quote.vue index eb07372cb8..b309076972 100644 --- a/client-app/pages/account/edit-quote.vue +++ b/client-app/pages/account/edit-quote.vue @@ -190,7 +190,11 @@ const accountAddresses = computed(() => { ? organizationsAddresses.value.map((address) => ({ ...address, firstName, lastName })) : personalAddresses.value; }); -const quoteChanged = computed(() => !isEqual(originalQuote.value, quote.value)); +const quoteChanged = computed( + () => + !isEqual(originalQuote.value, quote.value) || + (billingAddressEqualsShipping.value && !isBillingAddressEqualsShipping.value) +); const quoteItemsValid = computed( () => !!quote.value?.items?.length && @@ -315,7 +319,11 @@ async function saveChanges(): Promise { } }); - if (quote.value!.addresses?.length && !isEqual(quote.value!.addresses, originalQuote.value!.addresses)) { + if ( + quote.value!.addresses?.length && + (!isEqual(quote.value!.addresses, originalQuote.value!.addresses) || + (billingAddressEqualsShipping.value && !isBillingAddressEqualsShipping.value)) + ) { if (billingAddressEqualsShipping.value) { setBillingAddressEqualsShippingAddress(); }