- Alle API-URLs nutzen jetzt `process.env.NEXT_PUBLIC_API_BASE_URL` - `fetchGisStationsMeasurements`, `fetchGisStationsStaticDistrict`, `fetchGisStationsStatusDistrict`, `fetchGisSystemStatic` angepasst - `idMap` und `idUser` werden dynamisch aus URL oder `.env.local` bezogen - Entfernte `config.js`-Abhängigkeit für API-URLs - `.env.local` erlaubt jetzt flexible Server-IPs ohne Code-Anpassung
11 lines
387 B
JavaScript
11 lines
387 B
JavaScript
// /redux/api/fromWebService/fetchGisStationsMeasurements.js
|
|
const apiBaseUrl = process.env.NEXT_PUBLIC_API_BASE_URL;
|
|
|
|
export const fetchGisStationsMeasurements = async () => {
|
|
const response = await fetch(`${apiBaseUrl}/GisStationsMeasurements`);
|
|
if (!response.ok) {
|
|
throw new Error("GisStationsMeasurements konnte nicht geladen werden");
|
|
}
|
|
return await response.json();
|
|
};
|