Dashboard aktiv in navigtion beim ersten Aufruf
This commit is contained in:
@@ -7,7 +7,10 @@ const DeviceData = () => {
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
try {
|
||||
const response = await fetch("/api/fetchDeviceData");
|
||||
// Stelle sicher, dass die URL auf den richtigen Server zeigt (localhost:3000)
|
||||
const response = await fetch(
|
||||
"http://localhost:3000/api/fetchDeviceData"
|
||||
);
|
||||
if (!response.ok) {
|
||||
throw new Error(`Fehler beim Abrufen der Daten: ${response.status}`);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ function Navigation() {
|
||||
}, [pathname]);
|
||||
|
||||
const menuItems = [
|
||||
{ name: "Übersicht", path: "/" },
|
||||
{ name: "Übersicht", path: "/dashboard" },
|
||||
{ name: "Kabelüberwachung", path: "/kabelueberwachung" },
|
||||
{ name: "Zutrittskontrolle", path: "/access" },
|
||||
{ name: "Ein- und Ausgänge", path: "/einausgaenge" },
|
||||
|
||||
Reference in New Issue
Block a user