Skip to content

Commit

Permalink
Reverted: removed the unnecessary changes in the getOrderDetail actio…
Browse files Browse the repository at this point in the history
…n(#dxp/288)
  • Loading branch information
R-Sourabh committed Nov 18, 2024
1 parent 3d1599f commit ae76142
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 @@ -70,22 +70,8 @@ const actions: ActionTree<OrderState, RootState> = {
},
async getOrderDetail({ commit, state }, { orderId }) {
let resp;

const current = state.current as any
const orders = state.purchaseOrders.list as any
const currentFacilityId = getCurrentFacilityId();

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 ae76142

Please sign in to comment.