-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactored: setEcomStore and setShopifyConfig actions to accept ID. (#2tzh44d) #241
Changes from 5 commits
383b385
25b04b9
06f37a2
87dc4ed
0fd3d5c
c7c082d
8d22484
57fe77e
e064808
a41a43a
e5385f1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,14 +88,13 @@ export default defineComponent({ | |
methods: { | ||
setEComStore(store: any) { | ||
if(this.userProfile) { | ||
this.store.dispatch('user/setEcomStore', { | ||
'eComStore': this.userProfile.stores.find((str: any) => str.productStoreId == store['detail'].value) | ||
}) | ||
const productStore = this.userProfile.stores.find((str: any) => str.productStoreId === store['detail'].value); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should not find the product store here, we could just pass the productStoreId here and action should handle if id is provided it finds the product store & set it and if product store is provided it should set it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, sir, understood. |
||
this.store.dispatch('user/setEcomStore', productStore ? productStore.productStoreId : {}); | ||
} | ||
}, | ||
setShopifyConfig(event: any){ | ||
const shopifyConfig = this.shopifyConfigs.find((shopifyConfig: any) => shopifyConfig.shopifyConfigId === event.detail.value) | ||
this.store.dispatch('user/setCurrentShopifyConfig', shopifyConfig); | ||
const currentShopifyConfig = this.shopifyConfigs.find((shopifyConfig: any) => shopifyConfig.shopifyConfigId === event.detail.value); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Refer comments provided for the product store There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, sure. |
||
this.store.dispatch('user/setCurrentShopifyConfig', currentShopifyConfig ? currentShopifyConfig.shopifyConfigId : {}); | ||
}, | ||
async changeTimeZone() { | ||
const timeZoneModal = await modalController.create({ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest we check if payload has productStoreId we find the productStore and if productStore we set it as is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, sir, will change it as stated.