From 8b46ffd9a55128b6d1e0d201b06f5eb7cfb6651a Mon Sep 17 00:00:00 2001 From: Disha Talreja Date: Wed, 8 Feb 2023 12:07:29 +0530 Subject: [PATCH] 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}); }