From dec78695e588f1d15f37f8b1512b50a99b34ed23 Mon Sep 17 00:00:00 2001
From: Hugo <hnouts.dev@gmail.com>
Date: Wed, 24 Feb 2021 15:34:36 +0100
Subject: [PATCH] logs

---
 src/index.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/index.js b/src/index.js
index 7372806..4af6b62 100644
--- a/src/index.js
+++ b/src/index.js
@@ -16,7 +16,7 @@ moment.tz.setDefault("Europe/Paris"); // set the timezone
 const startDate = moment()
   .startOf("year")
   // .subtract(3, "year")
-  .subtract(6, "month")
+  .subtract(1, "month")
   .subtract(1, "day")
   .format("MM/DD/YYYY");
 const endDate = moment().format("MM/DD/YYYY");
@@ -148,6 +148,7 @@ async function getData(response, baseUrl, apiAuthKey) {
 }
 
 function format(response) {
+  log("info", "origin response size is : " + response.resultatRetour.length)
   const data = response.resultatRetour
     .slice(1)
     .filter(value => value.ValeurIndex);
@@ -245,7 +246,7 @@ async function storeData(data, doctype, keys) {
   log("debug", "Store into " + doctype);
   log("debug", "Store into keys : " + keys);
   data.map(v => {
-    log("info", "Saving data " + v.load + " for " + v.day + "/" + v.month);
+    log("info", "Saving data " + v.load + " for " + v.day + "/" + v.month + "/" + v.year);
   });
   return hydrateAndFilter(data, doctype, {
     keys: keys
-- 
GitLab