Skip to content

Commit

Permalink
Fixed: issue of shipGroup information(#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
ymaheshwari1 committed Oct 20, 2023
1 parent 6dd82f4 commit 9db758b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/store/modules/order/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ const actions: ActionTree<OrderState, RootState> = {

const orderQueryPayload = prepareOrderQuery(params)

let resp, total, shipGroups;
let resp, total, shipGroups = [];
const facilityTypeIds: Array<string> = [];

try {
Expand All @@ -574,6 +574,11 @@ const actions: ActionTree<OrderState, RootState> = {
logger.error('Failed to fetch ship group information for order', err)
}

// return if shipGroups are not found for order
if(!shipGroups.length) {
return;
}

shipGroups = shipGroups.map((shipGroup: any) => {
const shipItem = shipGroup.doclist.docs[0]

Expand Down Expand Up @@ -612,7 +617,7 @@ const actions: ActionTree<OrderState, RootState> = {

const orderQueryPayload = prepareOrderQuery(params)

let resp, total, shipGroups: any;
let resp, total, shipGroups: any = [];

try {
resp = await OrderService.findOrderShipGroup(orderQueryPayload);
Expand Down

0 comments on commit 9db758b

Please sign in to comment.