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");