Skip to content

Commit

Permalink
Merge pull request #56 from amansinghbais/facilities/fixProductStoreS…
Browse files Browse the repository at this point in the history
…election

Improved: logic for adding and removing product stores in selectProductStore modal based on productStoreId
  • Loading branch information
ravilodhi authored Dec 12, 2023
2 parents 5848d1d + c6a7e55 commit b6e6e78
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/SelectProductStoreModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ export default defineComponent({
modalController.dismiss({ dismissed: true});
},
saveProductStores() {
const productStoresToCreate = this.selectedProductStoreValues.filter((selectedFacility: any) => !this.selectedProductStores.some((facility: any) => facility.facilityId === selectedFacility.facilityId))
const productStoresToRemove = this.selectedProductStores.filter((facility: any) => !this.selectedProductStoreValues.some((selectedFacility: any) => facility.facilityId === selectedFacility.facilityId))
const productStoresToCreate = this.selectedProductStoreValues.filter((selectedStore: any) => !this.selectedProductStores.some((store: any) => store.productStoreId === selectedStore.productStoreId))
const productStoresToRemove = this.selectedProductStores.filter((store: any) => !this.selectedProductStoreValues.some((selectedStore: any) => store.productStoreId === selectedStore.productStoreId))
modalController.dismiss({
dismissed: true,
Expand Down

0 comments on commit b6e6e78

Please sign in to comment.