From 9361de6cb09fb8fa49ece28c6c4f38fa95b54d60 Mon Sep 17 00:00:00 2001 From: Tim Aldinger Date: Fri, 9 Oct 2026 21:00:43 +0200 Subject: [PATCH] =?UTF-8?q?dateien=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/js/pages/index/api/indexAPI.js | 21 +++++++++++++++++++ .../static/js/pages/index/frontend/indexUI.js | 0 2 files changed, 21 insertions(+) create mode 100644 src/main/resources/static/js/pages/index/api/indexAPI.js create mode 100644 src/main/resources/static/js/pages/index/frontend/indexUI.js diff --git a/src/main/resources/static/js/pages/index/api/indexAPI.js b/src/main/resources/static/js/pages/index/api/indexAPI.js new file mode 100644 index 0000000..d1bc5d8 --- /dev/null +++ b/src/main/resources/static/js/pages/index/api/indexAPI.js @@ -0,0 +1,21 @@ + + + +export async function addList(listName) { + const response = await fetch(`/api/list`, + { + method: "POST", + body: JSON.stringify({ listName: listName }), + headers: { "Content-Type": "application/json" } + } + ); + + return response; +} + +export async function deleteList(id) { + const response = await fetch(`/api/list/${id}`, { method: "DELETE" }) + .then(r => console.log("Liste entfernt")) + return response; +} + diff --git a/src/main/resources/static/js/pages/index/frontend/indexUI.js b/src/main/resources/static/js/pages/index/frontend/indexUI.js new file mode 100644 index 0000000..e69de29