diff --git a/src/store/modules/orderRouting/actions.ts b/src/store/modules/orderRouting/actions.ts index 50631e1..4d3a3c6 100644 --- a/src/store/modules/orderRouting/actions.ts +++ b/src/store/modules/orderRouting/actions.ts @@ -31,6 +31,25 @@ const actions: ActionTree = { } if(routingGroups.length) { + const groupScheduleInfoPayload = routingGroups.map((group: any) => { + return group.routingGroupId + }) + + const resp = await Promise.allSettled(groupScheduleInfoPayload.map((routingGroupId: any) => OrderRoutingService.fetchRoutingScheduleInformation(routingGroupId))) + + // Performing check on only those responses for which the status is fulfilled + const schedules = resp.filter((response: any) => response.status === "fulfilled").reduce((schedules: any, response: any) => { + if(response.value.data.schedule) { + schedules[response.value.data.schedule.jobName] = response.value.data.schedule + } + return schedules; + }, {}) + + routingGroups = routingGroups.map((group: any) => ({ + ...group, + schedule: schedules[group.jobName] + })) + routingGroups = sortSequence(routingGroups) } diff --git a/src/views/BrokeringRoute.vue b/src/views/BrokeringRoute.vue index d547135..e7ea4e2 100644 --- a/src/views/BrokeringRoute.vue +++ b/src/views/BrokeringRoute.vue @@ -85,12 +85,10 @@