From 2e11917ea16379e1a16dfd2323d9fb87e1103347 Mon Sep 17 00:00:00 2001 From: Tim Aldinger Date: Wed, 14 Oct 2026 13:54:36 +0200 Subject: [PATCH] addCategory erstellt ein li an was das cateogyr-element angehangen wird --- .../resources/static/js/pages/list/frontend/categoryUI.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/resources/static/js/pages/list/frontend/categoryUI.js b/src/main/resources/static/js/pages/list/frontend/categoryUI.js index f5b5e46..1d00dd2 100644 --- a/src/main/resources/static/js/pages/list/frontend/categoryUI.js +++ b/src/main/resources/static/js/pages/list/frontend/categoryUI.js @@ -3,10 +3,15 @@ export function addCategory(categoryAsJSON) { const list = document.querySelector(".displayedList"); const category = document.createElement("shopping-category"); + const li = document.createElement("li"); + li.classList.add("category"); + li.dataset.id = categoryAsJSON.categoryID; category.setAttribute("category-name", categoryAsJSON.categoryName); - list.append(category); //fügt Kategorie der Liste hinzu + li.append(category); //fügt Kategorie der Liste hinzu + + list.append(li); const categorySelect = document.querySelector(".addItemForm__categorySelect"); const newCategoryOption = document.createElement("option");