From 5569f35037e360c647978a4417c9581f9be3e791 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 2 Mar 2026 18:57:22 +0900 Subject: [PATCH] elemente statt todos in dashboard --- public/dashboard.html | 4 ++-- public/dashboard.js | 6 +++--- src/routes/elementRoutes.js | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/public/dashboard.html b/public/dashboard.html index 50e2070..d5ad6db 100644 --- a/public/dashboard.html +++ b/public/dashboard.html @@ -12,8 +12,8 @@ -

Todos

- +

Elemente

+

diff --git a/public/dashboard.js b/public/dashboard.js index df2bc08..6108dac 100644 --- a/public/dashboard.js +++ b/public/dashboard.js @@ -21,11 +21,11 @@ logoutBtn.addEventListener("click", () => { }); // Lade Todos vom Backend -async function loadTodos() { +async function loadElements() { try { - const res = await authFetch("/todos"); // fetchWrapper sendet den JWT Automatisch + const res = await authFetch("/elements"); // fetchWrapper sendet den JWT Automatisch if (!res.ok) { - errorMessage.textContent = "Fehler beim Abrufen der Todos!"; + errorMessage.textContent = "Fehler beim Abrufen der Elemente!"; if (res.status === 401) { window.location.href = "login.html"; // bei ungültigem Token zum Login } diff --git a/src/routes/elementRoutes.js b/src/routes/elementRoutes.js index 0de9c2b..17c415f 100644 --- a/src/routes/elementRoutes.js +++ b/src/routes/elementRoutes.js @@ -3,7 +3,7 @@ import prisma from '../prismaClient.js' const router = express.Router() -router.get('/', async (req, res) => { +router.get('/elements', async (req, res) => { try { // Versuche es mit exakt dem Namen aus deinem Schema (Elements) const data = await prisma.Elements.findMany();