From e2b0e716ccec62a99ded56af63c506967c53dc35 Mon Sep 17 00:00:00 2001 From: Disha Talreja Date: Tue, 7 Feb 2023 19:05:47 +0530 Subject: [PATCH 1/3] fix: select all not working --- src/views/PurchaseOrderReview.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/views/PurchaseOrderReview.vue b/src/views/PurchaseOrderReview.vue index 99fba765..80e12dd4 100644 --- a/src/views/PurchaseOrderReview.vue +++ b/src/views/PurchaseOrderReview.vue @@ -288,6 +288,7 @@ export default defineComponent({ } }) } + this.store.dispatch('order/updatePurchaseOrders', this.purchaseOrders); }, revertAll() { this.purchaseOrders.parsed = JSON.parse(JSON.stringify(this.purchaseOrders.original)); From 8b46ffd9a55128b6d1e0d201b06f5eb7cfb6651a Mon Sep 17 00:00:00 2001 From: Disha Talreja Date: Wed, 8 Feb 2023 12:07:29 +0530 Subject: [PATCH 2/3] fix: revert all not working as expected --- src/store/modules/order/actions.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/store/modules/order/actions.ts b/src/store/modules/order/actions.ts index 930d88ff..a2744d0c 100644 --- a/src/store/modules/order/actions.ts +++ b/src/store/modules/order/actions.ts @@ -54,15 +54,17 @@ const actions: ActionTree = { }, updateUnidentifiedItem({ commit, state }, payload: any) { const parsed = state.purchaseOrders.parsed as any; + let original = state.purchaseOrders.original as any; const unidentifiedItems = payload.unidentifiedItems.map((item: any) => { if(item.updatedSku) { item.shopifyProductSKU = item.updatedSku; parsed[item.orderId].push(item); + original[item.orderId].push(item) } else { return item; } }).filter((item: any) => item); - const original = JSON.parse(JSON.stringify(state.purchaseOrders.parsed)); + original = JSON.parse(JSON.stringify(state.purchaseOrders.original)); commit(types.ORDER_PURCHASEORDERS_UPDATED, { parsed, original, unidentifiedItems}); } From d114b7759692bd46a435172de249fc1a2540f33d Mon Sep 17 00:00:00 2001 From: Disha Talreja Date: Wed, 22 Feb 2023 12:40:57 +0530 Subject: [PATCH 3/3] improved code --- src/store/modules/order/actions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store/modules/order/actions.ts b/src/store/modules/order/actions.ts index 58f8e586..05e5bb52 100644 --- a/src/store/modules/order/actions.ts +++ b/src/store/modules/order/actions.ts @@ -58,7 +58,7 @@ const actions: ActionTree = { if(item.updatedSku) { item.shopifyProductSKU = item.updatedSku; parsed[item.orderId] ? parsed[item.orderId].push(item) : parsed[item.orderId] = [item]; - original[item.orderId].push(item) + original[item.orderId] ? original[item.orderId].push(item) : original[item.orderId] = [item]; } else { return item; }