Datasheet Markdown

This commit is contained in:
Ismail Ali
2025-05-17 12:30:45 +02:00
parent 12eb84f267
commit 695ec7a55c
5 changed files with 205 additions and 14 deletions

View File

@@ -1,18 +1,21 @@
// /redux/api/fromDB/fetchLocationDevices.js
// /redux/slices/webService/gisStationsStaticSlice.js
// das ist für Datasheet dropdownmenu Bereiche/Area-Name
import { createSlice, createAsyncThunk } from "@reduxjs/toolkit";
// API-Fetch-Funktion für GIS Stations Static mit dynamischem URL-Parameter
export const fetchGisStationsStatic = createAsyncThunk("gisStationsStatic/fetchGisStationsStatic", async (_, { rejectWithValue }) => {
try {
const apiBaseUrl = `${window.location.origin}/talas5/ClientData/WebServiceMap.asmx`;
const host = window.location.hostname;
const protocol = window.location.protocol;
const apiPort = 80; // Oder aus einer Umgebungsvariable
const apiBaseUrl = `${protocol}//${host}:${apiPort}/talas5/ClientData/WebServiceMap.asmx`;
// URL-Parameter aus der aktuellen Browser-URL holen
const params = new URLSearchParams(window.location.search);
const idMap = params.get("idMap") || "12"; // Standardwert "12", falls `idMap` nicht existiert
const idMap = params.get("m");
const url = `${apiBaseUrl}/GisStationsStatic?idMap=${idMap}`;
console.log("📡 API Request URL:", url);
console.log("📡 API Request URL in redux slice:", url);
const response = await fetch(url);