Modified Frontend for it to use new endpoints
This commit is contained in:
@@ -7,7 +7,8 @@
|
||||
},
|
||||
"appConfig": {
|
||||
"endpoints": {
|
||||
"BASE_URL": "http://localhost:8081/api/v1",
|
||||
"DATA_URL": "http://localhost:8081/api/v1",
|
||||
"LOGIC_URL": "http://localhost:8082/api/v1",
|
||||
"GET_GROUPS": "/groups",
|
||||
"GET_GROUP_BY_ID": "/groups/{0}",
|
||||
"GET_GROUP_DEVICES": "/groups/{0}/devices",
|
||||
|
||||
@@ -44,7 +44,7 @@ const HistoryCharts = () => {
|
||||
if (configError) return <p>Error al cargar configuración: {configError}</p>;
|
||||
if (!config) return <p>Configuración no disponible.</p>;
|
||||
|
||||
const BASE = config.appConfig.endpoints.BASE_URL;
|
||||
const BASE = config.appConfig.endpoints.LOGIC_URL;
|
||||
const ENDPOINT = config.appConfig.endpoints.sensors;
|
||||
|
||||
const reqConfig = {
|
||||
|
||||
@@ -65,7 +65,7 @@ const PollutionMap = ({ deviceId }) => {
|
||||
if (configError) return <p>Error al cargar configuración: {configError}</p>;
|
||||
if (!config) return <p>Configuración no disponible.</p>;
|
||||
|
||||
const BASE = config.appConfig.endpoints.BASE_URL;
|
||||
const BASE = config.appConfig.endpoints.LOGIC_URL;
|
||||
const ENDPOINT = config.appConfig.endpoints.GET_DEVICE_POLLUTION_MAP;
|
||||
let endp = ENDPOINT.replace('{0}', deviceId);
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ const SideMenu = ({ isOpen, onClose }) => {
|
||||
if (configError) return <p>Error al cargar configuración: {configError}</p>;
|
||||
if (!config) return <p>Configuración no disponible.</p>;
|
||||
|
||||
const BASE = config.appConfig.endpoints.BASE_URL;
|
||||
const BASE = config.appConfig.endpoints.DATA_URL;
|
||||
const ENDPOINT = config.appConfig.endpoints.GET_DEVICES;
|
||||
|
||||
const reqConfig = {
|
||||
|
||||
@@ -40,7 +40,7 @@ const SummaryCards = ({ deviceId }) => {
|
||||
if (configError) return <p>Error al cargar configuración: {configError}</p>;
|
||||
if (!config) return <p>Configuración no disponible.</p>;
|
||||
|
||||
const BASE = config.appConfig.endpoints.BASE_URL;
|
||||
const BASE = config.appConfig.endpoints.LOGIC_URL;
|
||||
const ENDPOINT = config.appConfig.endpoints.GET_DEVICE_LATEST_VALUES;
|
||||
const endp = ENDPOINT.replace('{0}', deviceId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user