From ca6539923c84ae97ff31ac2811e9262cc514955f Mon Sep 17 00:00:00 2001 From: cay Date: Sun, 5 Apr 2026 11:17:07 +0100 Subject: [PATCH] rtjhurt --- public/js/building.js | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 public/js/building.js diff --git a/public/js/building.js b/public/js/building.js deleted file mode 100644 index 9d02955..0000000 --- a/public/js/building.js +++ /dev/null @@ -1,29 +0,0 @@ -fetch("/api/buildings") - .then((res) => { - if (!res.ok) { - throw new Error("API Fehler"); - } - return res.json(); - }) - .then((buildings) => { - buildings.forEach((building) => { - const element = document.querySelector( - `.building[data-id="${building.id}"]`, - ); - - if (!element) return; - - let title = element.querySelector("title"); - - if (!title) { - title = document.createElementNS("http://www.w3.org/2000/svg", "title"); - element.prepend(title); - } - - title.textContent = building.name; - }); - }) - .catch((error) => { - console.error("Buildings API Fehler:", error); - }); -//test