Skip to content

Commit

Permalink
Reverted: caching of order detail from po list in state on order deta…
Browse files Browse the repository at this point in the history
…ils page (#380)
  • Loading branch information
amansinghbais committed Oct 22, 2024
1 parent 88d8306 commit 00b2698
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/store/modules/order/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,6 @@ const actions: ActionTree<OrderState, RootState> = {
async getOrderDetail({ commit, state }, { orderId }) {

Check warning on line 71 in src/store/modules/order/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

'state' is defined but never used

Check warning on line 71 in src/store/modules/order/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

'state' is defined but never used
let resp;

const current = state.current as any
const orders = state.purchaseOrders.list as any

if (current.length && current[0]?.orderId === orderId) { return current }

else if(orders.length > 0) {
return orders.some((order: any) => {
if (order.doclist.docs[0]?.orderId === orderId) {
this.dispatch('product/fetchProductInformation', { order: order.doclist.docs });
commit(types.ORDER_CURRENT_UPDATED, { ...state.current, orderId: order.doclist.docs[0]?.orderId, externalOrderId: order.doclist.docs[0]?.externalOrderId, orderStatusId: order.doclist.docs[0]?.orderStatusId, orderStatusDesc: order.doclist.docs[0]?.orderStatusDesc, items: JSON.parse(JSON.stringify(order.doclist.docs)) })
return current;
}
})
}
try {
const payload = {
"json": {
Expand Down

0 comments on commit 00b2698

Please sign in to comment.