Skip to content
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

Improved: Fixed popover not closing and corrected the primary store tag display issue(#304) #317

Merged
merged 3 commits into from
Nov 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/components/ProductStorePopover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,16 @@ export default defineComponent({
// TODO: need to check if we need to remove primary value from the facility if product store is removed.
// Removing primaryFacilityGroupId from the facility, if present
if(this.shopifyShopIdForProductStore(this.currentProductStore.productStoreId) === this.current.primaryFacilityGroupId) {
await FacilityService.updateFacility({
const updateResp = await FacilityService.updateFacility({
facilityId: this.facilityId,
primaryFacilityGroupId: ''
})
});
if (!hasError(updateResp)) {
await this.store.dispatch('facility/updateCurrentFacility', { ...this.current, primaryFacilityGroupId: '' });
} else {
throw updateResp.data;
}
}

// refetching product stores with updated roles
await this.store.dispatch('facility/getFacilityProductStores', { facilityId: this.facilityId })
} else {
Expand Down Expand Up @@ -119,6 +123,7 @@ export default defineComponent({
// if we does not get shopify shop id for the store then not making product store as primary
if(!shopifyShopId) {
showToast(translate('Failed to make product store primary due to missing Shopify shop'))
popoverController.dismiss()
emitter.emit('dismissLoader')
return;
}
Expand Down
Loading