Skip to content
Snippets Groups Projects
Commit 32b0cfb8 authored by Rémi PAILHAREY's avatar Rémi PAILHAREY :fork_knife_plate:
Browse files

refactor: removed useless variable and log

parent 78f64ada
No related branches found
No related tags found
1 merge request!22Chore/update node version to 16
Pipeline #50279 passed
......@@ -210,11 +210,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) {
......@@ -242,15 +241,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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment