refactor: Services nach Datenquelle getrennt – webservice/, database/ und utils/ Struktur eingeführt (v1.1.117)

This commit is contained in:
ISA
2025-05-20 13:27:20 +02:00
parent e3b8f7f0fc
commit 2846bc0b13
17 changed files with 29 additions and 10 deletions

View File

@@ -0,0 +1,15 @@
// /services/api/fetchDeviceNameById.js
export const fetchDeviceNameById = async (idLD) => {
try {
const response = await fetch(`/api/talas_v5_DB/locationDevice/locationDeviceNameById?idLD=${idLD}`);
const data = await response.json();
if (response.ok) {
return data.name;
} else {
throw new Error("Gerät nicht gefunden");
}
} catch (error) {
console.error("Fehler beim Abrufen des Gerätenamens in fetchDeviceNameById:", error);
return "Unbekannt";
}
};