Skip to content

Commit

Permalink
Merge pull request #16 from amansinghbais/15-value-validation
Browse files Browse the repository at this point in the history
Improved: added validation in product store setting value (#15)
  • Loading branch information
ymaheshwari1 authored May 31, 2024
2 parents 4759485 + 4fee308 commit 0cca957
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 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,8 @@ async function updateProductStoreSettings(event: any, enumId: string, isToggle:
}
}
} else {
if((!settingEnums[enumId]?.settingValue && !event.target.value.trim()) || (settingEnums[enumId]?.settingValue && settingEnums[enumId].settingValue === event.target.value.trim())) return;
if(settingEnums[enumId]) {
payload = {
...settingEnums[enumId],
Expand Down

0 comments on commit 0cca957

Please sign in to comment.