From 2a22f4cdccfa78303a86568793f33039e33602ce Mon Sep 17 00:00:00 2001 From: build-token <build-token> Date: Wed, 11 Jan 2023 16:27:44 +0000 Subject: [PATCH] publish: refactor: removed useless variable and log generated from commit 32b0cfb8d242e25ad75159aa2cd6e6e3973a107b --- index.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/index.js b/index.js index 1e65570..b2762ba 100644 --- a/index.js +++ b/index.js @@ -215,11 +215,10 @@ async function authenticate(login, password, baseUrl, apiAuthKey) { } try { const resp = await axios(authRequest) - const data = resp.data - if (data.codeRetour === 100) { - return data + if (resp.data.codeRetour === 100) { + return resp.data } else { - Sentry.captureException(JSON.stringify(data)) + Sentry.captureException(JSON.stringify(resp.data)) throw new Error() } } catch (error) { @@ -247,15 +246,13 @@ async function getData(response, baseUrl, apiAuthKey) { try { // Sort data by date const resp = await axios(dataRequest) - const data = await resp.data - log('debug', data) - data.resultatRetour.sort(function(a, b) { + resp.data.resultatRetour.sort(function(a, b) { return new Date(a.DateReleve) - new Date(b.DateReleve) }) - switch (data.codeRetour) { + switch (resp.data.codeRetour) { case 100: - return format(data) + return format(resp.data) case -2: throw errors.LOGIN_FAILED case -1: -- GitLab