From 4cdabceb5784a54f1dbe673d82a414a03b0e0f92 Mon Sep 17 00:00:00 2001 From: "Begerad, Stefan" Date: Tue, 31 May 2022 15:21:41 +0200 Subject: [PATCH] refactor(week-from-obj): handling logs --- week-from-obj/index.js | 9 +++++++-- week-from-obj/service.js | 16 ++++++++-------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/week-from-obj/index.js b/week-from-obj/index.js index 8b3bce1..1f7c9b7 100644 --- a/week-from-obj/index.js +++ b/week-from-obj/index.js @@ -28,7 +28,9 @@ async function run() { let count = Object.keys(objRoutes).length; debug('objRoutes count: ' + count); let aryRoutes =Object.entries(objRoutes); - for(var j=0;j<1;j++){ + let aryWeekTripsCount=[0,0,0,0,0,0,0]; + debug('aryWeekTripsCount.length: '+aryWeekTripsCount.length); + for(var j=0;j<2;j++){ debug('j: '+j); let routeId=aryRoutes[i][0]; debug('routeId: ' + routeId); @@ -38,7 +40,10 @@ async function run() { let aryTripsCount=[0,0,0,0,0,0,0]; aryTripsCount=routeService.getTripsCountFromRoute(routeShortName,thisWeek); //TODO Why is aryTripsCount undefined? - debug('aryTripsCount: '+aryTripsCount[0]); + debug('aryTripsCount len: '+aryTripsCount.length); + for(var k=0;k