From dfe79de3e9bbc62c2daf851b31e5ab52699ee94a Mon Sep 17 00:00:00 2001 From: mialy Date: Tue, 16 Apr 2024 15:09:19 +0200 Subject: [PATCH] fix(data): api call --- client/src/pages/country/components/export.js | 2 +- client/src/pages/country/components/research/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/pages/country/components/export.js b/client/src/pages/country/components/export.js index 6ff6a1c..58c694f 100644 --- a/client/src/pages/country/components/export.js +++ b/client/src/pages/country/components/export.js @@ -37,7 +37,7 @@ export default function ExportPage() { policyBlocs.push(dataAnalyse.find((el) => (el.fields.codethematique === 'A3'))?.fields || null); policyBlocs.push(dataAnalyse.find((el) => (el.fields.codethematique === 'A4'))?.fields || null); dataES = dataAnalyse.find((el) => (el.fields.codethematique === 'A5'))?.fields || null; - dataRI = dataAnalyse.find((el) => (el.fields.codethematique === 'A6')).fields || null; + dataRI = dataAnalyse.find((el) => (el.fields.codethematique === 'A6'))?.fields || null; cooperationBlocs.push(dataAnalyse.find((el) => (el.fields.codethematique === 'A7'))?.fields || null); cooperationBlocs.push(dataAnalyse.find((el) => (el.fields.codethematique === 'A8'))?.fields || null); diff --git a/client/src/pages/country/components/research/index.js b/client/src/pages/country/components/research/index.js index 2f02ef0..68e074b 100644 --- a/client/src/pages/country/components/research/index.js +++ b/client/src/pages/country/components/research/index.js @@ -25,7 +25,7 @@ export default function CountryResearchPage() { const charts2nd = charts.filter((indic) => indic.theme === 'personnel'); if (data.length !== 0) { - dataRI = data.find((el) => (el.fields.codethematique === 'A6')).fields || null; + dataRI = data.find((el) => (el.fields.codethematique === 'A6'))?.fields || null; } else { dataRI = ''; }