jeremy 4 months ago
parent
commit
144ae9aa59
1 changed files with 2 additions and 2 deletions
  1. 2 2
      backend/src/routes/irl.js

+ 2 - 2
backend/src/routes/irl.js

@@ -18,8 +18,8 @@ async function fetchIrlFromInsee(year, quarter) {
 
   const xml = await resp.text();
 
-  // SDMX-XML : extraire <generic:ObsValue value="142.06"/>
-  const match = xml.match(/ObsValue[^/]*value="([\d.]+)"/);
+  // SDMX-XML : extraire <generic:ObsValue value="142.06"/> OBS_VALUE="144.51"
+  const match = xml.match(/OBS_VALUE="([\d.]+)"/);
   if (!match) throw new Error('Valeur IRL introuvable dans la réponse XML');
 
   return parseFloat(match[1]);