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