Skip to content
Snippets Groups Projects
Commit 256d7cbe authored by i-vall's avatar i-vall
Browse files

fix: values now accurate and no longer added up

parent e6004392
Branches
No related tags found
No related merge requests found
...@@ -93,11 +93,12 @@ async function getData(response) { ...@@ -93,11 +93,12 @@ async function getData(response) {
throw new Error(errors.VENDOR_DOWN) throw new Error(errors.VENDOR_DOWN)
} }
} }
function format(response) { function format(response) {
const data = response.resultatRetour.map(value => { const data = response.resultatRetour.slice(1).map((value, index) => {
return { return {
time: moment(value.DateReleve, moment.ISO_8601).format('YYYY-MM-DD'), time: moment(value.DateReleve, moment.ISO_8601).format('YYYY-MM-DD'),
load: value.ValeurIndex, load: value.ValeurIndex - response.resultatRetour[index].ValeurIndex,
type: value.TypeAgregat type: value.TypeAgregat
} }
}) })
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment