Skip to content

Commit

Permalink
Merge pull request #317 from R-Sourabh/#304-primary-product-store
Browse files Browse the repository at this point in the history
Improved: Fixed popover not closing and corrected the primary store tag display issue(#304)
  • Loading branch information
ravilodhi authored Nov 20, 2024
2 parents 39dbb7b + 9191a81 commit d0a7da3
Showing 1 changed file with 8 additions and 3 deletions.
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

0 comments on commit d0a7da3

Please sign in to comment.