From e7efc275cd3c3535d06e5dc5fdcdb3ffb45e6add Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Fri, 26 Jan 2024 22:07:45 +0530 Subject: [PATCH 1/4] Fixed: when creating routing for a new group the app breaks with undefined error --- src/store/modules/orderRouting/actions.ts | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/store/modules/orderRouting/actions.ts b/src/store/modules/orderRouting/actions.ts index 9f4d34a..3128138 100644 --- a/src/store/modules/orderRouting/actions.ts +++ b/src/store/modules/orderRouting/actions.ts @@ -67,7 +67,7 @@ const actions: ActionTree = { logger.error(err); } - if(currentGroup.routings.length) { + if(currentGroup.routings?.length) { currentGroup.routings = sortSequence(currentGroup.routings) } @@ -83,10 +83,18 @@ const actions: ActionTree = { if(!hasError(resp) && resp?.data.orderRoutingId) { orderRoutingId = resp.data.orderRoutingId - currentGroup["routings"].push({ - ...payload, - orderRoutingId - }) + // Added check, as when there is no routing we need to create the key as well, but if routings already exist then we just need to push the value + if(currentGroup["routings"]) { + currentGroup["routings"].push({ + ...payload, + orderRoutingId + }) + } else { + currentGroup["routings"] = [{ + ...payload, + orderRoutingId + }] + } showToast('New routing created') } From bfa8b54d7defef7ea91413a0d299ba96193d77b6 Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Fri, 26 Jan 2024 22:08:51 +0530 Subject: [PATCH 2/4] Improved: checks for brokering run creation and used getTime method from util to show date on UI --- src/views/BrokeringRuns.vue | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/views/BrokeringRuns.vue b/src/views/BrokeringRuns.vue index 4e961d2..72f90d2 100644 --- a/src/views/BrokeringRuns.vue +++ b/src/views/BrokeringRuns.vue @@ -30,10 +30,10 @@ {{ group.runTime ? group.runTime : "-" }} - {{ group.createdDate ? group.createdDate : "-" }} + {{ getTime(group.createdDate) }} - - {{ group.lastUpdatedStamp ? group.lastUpdatedStamp : "-" }} + + {{ getTime(group.lastUpdatedStamp) }} @@ -47,6 +47,7 @@