- entfernt: NEXT_PUBLIC_SERVER_URL aus fetchGisStatusStations.js - ersetzt durch dynamischen URL-Aufbau via NEXT_PUBLIC_API_PORT_MODE - neue Doku erstellt: docs/frontend/services/api/fetchGisStatusStations.md - CHANGELOG.md aktualisiert (v1.1.78)
28 lines
871 B
JavaScript
28 lines
871 B
JavaScript
// /services/api/fetchGisStatusStations.js
|
|
import fetchWithTimeout from "./fetchWithTimeout";
|
|
|
|
export const fetchGisStatusStations = async (idMap, idUser) => {
|
|
const mode = process.env.NEXT_PUBLIC_API_PORT_MODE;
|
|
|
|
const SERVER_URL = mode === "dev" ? `${window.location.protocol}//${window.location.hostname}:80` : `${window.location.origin}`;
|
|
|
|
return fetchWithTimeout(
|
|
`${SERVER_URL}/talas5/ClientData/WebServiceMap.asmx/GisStationsStatusDistrict?idMap=${idMap}&idUser=${idUser}`,
|
|
{
|
|
method: "GET",
|
|
headers: {
|
|
Connection: "close",
|
|
},
|
|
},
|
|
5000
|
|
)
|
|
.then((response) => {
|
|
if (!response.ok) throw new Error(`Error: ${response.statusText}`);
|
|
return response.json();
|
|
})
|
|
.catch((error) => {
|
|
console.error("Fehler beim Abrufen der Daten in fetchGisStatusStations:", error);
|
|
throw error;
|
|
});
|
|
};
|