1
0
mirror of https://github.com/franjsco/covid19-campania synced 2025-02-26 16:18:17 +01:00

Fix 404 del json

This commit is contained in:
Francesco Esposito 2020-04-07 20:37:37 +02:00
parent 31d9f29ff2
commit c10dab2a02

View File

@ -18,10 +18,14 @@ const getJsonRegioni = async () => {
const getData = async () => { const getData = async () => {
let result;
const nomeRegione = 'Campania'; const nomeRegione = 'Campania';
const datiRegione = await getJsonRegioni(); const datiRegione = await getJsonRegioni();
const result = datiRegione.find((regione) => regione.denominazione_regione === nomeRegione);
if (datiRegione) {
result = datiRegione.find((regione) => regione.denominazione_regione === nomeRegione);
}
return result; return result;
}; };