diff --git a/src/api/index.js b/src/api/index.js index 975b0939..be964f3f 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -178,14 +178,14 @@ const CITIES_LOCATION = { const API = { getAirData(city) { - return fetch(`https://api.sensors.africa/v2/data/air/?city=${city}`); + return fetch(`${API_BASE_URL}/data/air/?city=${city}`); }, getWeeklyP2Data(city) { const fromDate = new Date(Date.now() - 7 * 24 * 3600 * 1000) .toISOString() .substring(0, 10); return fetch( - `https://api.sensors.africa/v2/data/air/?city=${city}&from=${fromDate}&interval=day&value_type=P2`, + `${API_BASE_URL}/data/air/?city=${city}&from=${fromDate}&interval=day&value_type=P2`, ); }, }; diff --git a/src/components/DataArchives/DataArchives.js b/src/components/DataArchives/DataArchives.js index f0bde9f5..9da17420 100644 --- a/src/components/DataArchives/DataArchives.js +++ b/src/components/DataArchives/DataArchives.js @@ -102,11 +102,11 @@ const countryCode = "{country name}"; const allCities = `${API_BASE_URL}/cities`; const specificCities = `${API_BASE_URL}/data/air?city={slug}&`; const nodes = `${API_BASE_URL}/nodes`; -const data5 = "http://api.sensors.africa/static/v2/data.json"; -const data1 = "http://api.sensors.africa/static/v2/data.1h.json"; -const data24 = "http://api.sensors.africa/static/v2/data.24h.json"; -const dataDust = "http://api.sensors.africa/static/v2/data.dust.min.json"; -const otherSensors = "http://api.sensors.africa/static/v2/data.temp.min.json"; +const data5 = `${API_STATIC_URL}/data.json`; +const data1 = `${API_STATIC_URL}/data.1h.json`; +const data24 = `${API_STATIC_URL}/data.24h.json`; +const dataDust = `${API_STATIC_URL}/data.dust.min.json`; +const otherSensors = `${API_STATIC_URL}/data.temp.min.json`; const toFrom = "{YYYY - mm - dd}"; const valueType = "{P1, P2, temperature, humidity}"; @@ -318,7 +318,7 @@ function DataArchives(props) { @@ -370,7 +370,7 @@ function DataArchives(props) { @@ -396,7 +396,7 @@ function DataArchives(props) { @@ -421,7 +421,7 @@ function DataArchives(props) { @@ -446,7 +446,7 @@ function DataArchives(props) { @@ -472,7 +472,7 @@ function DataArchives(props) {