addCategory erstellt ein li an was das cateogyr-element angehangen wird

This commit is contained in:
Technoir committed 2026-10-14 13:54:36 +02:00
1 parent 148c33cf6e
commit 2e11917ea1
1 file changed
+6 -1
@@ -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");