Skip to content

Commit

Permalink
Improved: Updated @ionChange handler to use ($event.detail.value) ins…
Browse files Browse the repository at this point in the history
…tead of $event(hotwax#193)
  • Loading branch information
R-Sourabh committed Oct 21, 2024
1 parent d57b1d9 commit a920ed6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/DxpProductStoreSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</ion-card-content>

<ion-item lines="none">
<ion-select :label="$t('Select store')" interface="popover" :placeholder="$t('store name')" :value="currentEComStore?.productStoreId" @ionChange="updateEComStore($event)">
<ion-select :label="$t('Select store')" interface="popover" :placeholder="$t('store name')" :value="currentEComStore?.productStoreId" @ionChange="updateEComStore($event.target.value)">
<ion-select-option v-for="store in (eComStores ? eComStores : [])" :key="store.productStoreId" :value="store.productStoreId">{{ store.storeName }}</ion-select-option>
</ion-select>
</ion-item>
Expand All @@ -32,9 +32,9 @@ const emit = defineEmits(["updateEcomStore"])
const eComStores = computed(() => userStore.getProductStores);
const currentEComStore = computed(() => userStore.getCurrentEComStore);
async function updateEComStore(event: any) {
if (event.target.value && currentEComStore.value?.productStoreId !== event.detail.value) {
const selectedProductStore = eComStores.value.find((store: any) => store.productStoreId == event.detail.value)
async function updateEComStore(eComStoreId: any) {
if (eComStoreId && currentEComStore.value?.productStoreId !== eComStoreId) {
const selectedProductStore = eComStores.value.find((store: any) => store.productStoreId == eComStoreId)
await userStore.setEComStorePreference(selectedProductStore)
emit('updateEcomStore', selectedProductStore)
}
Expand Down

0 comments on commit a920ed6

Please sign in to comment.