From 2f4c264b4b970fbaa5496a6fe8aca955488a883e Mon Sep 17 00:00:00 2001 From: ISA Date: Wed, 21 May 2025 14:59:05 +0200 Subject: [PATCH] =?UTF-8?q?refactor:=20entferne=20veralteten=20fetch-Block?= =?UTF-8?q?=20f=C3=BCr=20gisLinesStatus=20aus=20MapComponent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - fetch(...) durch Redux-Thunk ersetzt - Daten werden zentral über fetchLineStatusAndLinesThunk bereitgestellt - keine Redundanz oder Datenverluste festgestellt --- components/mainComponent/MapComponent.js | 34 ------------------------ config/appVersion.js | 2 +- 2 files changed, 1 insertion(+), 35 deletions(-) diff --git a/components/mainComponent/MapComponent.js b/components/mainComponent/MapComponent.js index e8d2e20bb..b90e1a64d 100644 --- a/components/mainComponent/MapComponent.js +++ b/components/mainComponent/MapComponent.js @@ -362,40 +362,6 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => { } }, [poiTypStatus, dispatch]); - //-------------------------------------------- - useEffect(() => { - const fetchData = async () => { - try { - const response1 = await fetch(webserviceGisLinesStatusUrl); - const data1 = await response1.json(); - //console.log("data1.Statis", data1.Statis); - const reversedData = data1.Statis.reverse(); - setLineStatusData(reversedData); - - const response2 = await fetch("/api/talas_v5_DB/gisLines/readGisLines"); - const data2 = await response2.json(); - - const colorsByModule = {}; - reversedData.forEach((stat) => { - if (!Array.isArray(data2)) { - console.warn("WARNUNG: gis_lines ist kein Array, wird ignoriert."); - return; - } - const matchingLine = data2.find((item) => item.idLD === stat.IdLD && item.idModul === stat.Modul); - - if (matchingLine) { - colorsByModule[matchingLine.idModul] = stat.PrioColor; - //console.log("Übereinstimmung gefunden für: ", stat); - setLinesData(matchingLine); - } - }); - //setLineColors(colorsByModule); - } catch (error) { - console.error("Error fetching data:", error); - } - }; - fetchData(); - }, []); //----------------------------------------------------------------- //Tooltip an mouse position anzeigen für die Linien useEffect(() => { diff --git a/config/appVersion.js b/config/appVersion.js index 595614d35..ceaee5fdc 100644 --- a/config/appVersion.js +++ b/config/appVersion.js @@ -1,2 +1,2 @@ // /config/appVersion -export const APP_VERSION = "1.1.132"; +export const APP_VERSION = "1.1.133";