Skip to content

Commit

Permalink
Fixed: gc fulfillment status not updating in list page on activating …
Browse files Browse the repository at this point in the history
…from details page (hotwax#716)
  • Loading branch information
amansinghbais committed Sep 2, 2024
1 parent bf39706 commit 9dace4e
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/store/modules/order/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1296,6 +1296,8 @@ const actions: ActionTree<OrderState, RootState> = {

if(!isGCActivated) return;

const orders = JSON.parse(JSON.stringify(category === "in-progress" ? state.inProgress.list : state.completed.list));

if(isDetailsPage) {
const order = JSON.parse(JSON.stringify(state.current));

Expand All @@ -1306,12 +1308,20 @@ const actions: ActionTree<OrderState, RootState> = {
}
})

orders.map((currentOrder: any) => {
if(currentOrder.orderId === order.orderId) currentOrder.items = order.items
})

if(category === "in-progress") {
commit(types.ORDER_INPROGRESS_UPDATED, { orders, total: state.inProgress.total })
} else {
commit(types.ORDER_COMPLETED_UPDATED, { list: orders, total: state.completed.total })
}

commit(types.ORDER_CURRENT_UPDATED, order)
return;
}

const orders = JSON.parse(JSON.stringify(category === "in-progress" ? state.inProgress.list : state.completed.list));

orders.map((order: any) => {
order.items.map((currentItem: any) => {
if(currentItem.orderId === item.orderId && currentItem.orderItemSeqId === item.orderItemSeqId) {
Expand Down

0 comments on commit 9dace4e

Please sign in to comment.