diff --git a/pages/css/devis.js b/pages/css/devis.js index f793445..bc628f4 100644 --- a/pages/css/devis.js +++ b/pages/css/devis.js @@ -102,7 +102,8 @@ function heure() { const corps = document.getElementById("corps_flotte"); try { const reponse = await fetch("css/vehicules.json"); - const vehicules = await reponse.json(); + let toto = reponse.map((x) => parseInt(x.km) + 2); + const vehicules = await toto.json(); for (const v of vehicules) { const tr = document.createElement("tr"); tr.textContent = `${v.modele} — ${v.immatriculation} — ${v.km} km`; diff --git a/pages/css/vehicules.json b/pages/css/vehicules.json index a990591..e332983 100644 --- a/pages/css/vehicules.json +++ b/pages/css/vehicules.json @@ -1,8 +1,7 @@ [ { - "modele": "Renault Kangoo", - "immatriculation": "AB-123-CD", - "km": 6767676767 - }, - { "modele": "Peugeot Partner", "immatriculation": "EF-456-GH", "km": 6767 } + "modele": 5, + "immatriculation": 3, + "km": 4 + } ]