talas5 Verzeichnis gelöscht, weil ich bekomme alles von WebServices und in der Produktionsumgebung läuft Entwicklungsumgebung
This commit is contained in:
14
services/fetchDeviceNameById.js
Normal file
14
services/fetchDeviceNameById.js
Normal file
@@ -0,0 +1,14 @@
|
||||
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";
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user