From 3ca2f2f87b4bc16439260f8729a69d0604f4a175 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Fri, 31 May 2024 19:33:35 +0530 Subject: [PATCH] Improved: added validation in product store setting value (#15) --- src/views/ProductStoreDetails.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/views/ProductStoreDetails.vue b/src/views/ProductStoreDetails.vue index fbce0e8..e9303c5 100644 --- a/src/views/ProductStoreDetails.vue +++ b/src/views/ProductStoreDetails.vue @@ -560,6 +560,7 @@ async function updateProductStoreDetail(event: any, fieldName: string, isToggle: event.stopImmediatePropagation(); payload = {[fieldName]: productStore.value[fieldName] === 'Y' ? 'N' : 'Y' }; } else { + if(event.target.value.trim() === productStore.value[fieldName]) return; payload = { [fieldName]: event.target.value }; } @@ -605,6 +606,9 @@ async function updateProductStoreSettings(event: any, enumId: string, isToggle: } } } else { + if(!settingEnums[enumId]?.settingValue && !event.target.value.trim()) return; + if(settingEnums[enumId]?.settingValue && settingEnums[enumId].settingValue === event.target.value.trim()) return; + if(settingEnums[enumId]) { payload = { ...settingEnums[enumId],