Skip to content

Commit

Permalink
Improved: added validation in product store setting value (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
amansinghbais committed May 31, 2024
1 parent 155ff9d commit 3ca2f2f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/views/ProductStoreDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
}
Expand Down Expand Up @@ -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],
Expand Down

0 comments on commit 3ca2f2f

Please sign in to comment.