From 7202eea4ccfd8b7351f251325ba28f0722d60fac Mon Sep 17 00:00:00 2001 From: Tim Aldinger Date: Fri, 9 Oct 2026 21:29:59 +0200 Subject: [PATCH] bug: categoryID war noch id --- src/main/resources/static/js/models/ShoppingCategory.js | 2 +- src/main/resources/static/js/pages/list/frontend/categoryUI.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/static/js/models/ShoppingCategory.js b/src/main/resources/static/js/models/ShoppingCategory.js index f1b6525..3d1eee9 100644 --- a/src/main/resources/static/js/models/ShoppingCategory.js +++ b/src/main/resources/static/js/models/ShoppingCategory.js @@ -6,7 +6,7 @@ export class ShoppingCategory { static fromJSON(categoryAsJSON) { const category = new ShoppingCategory(categoryAsJSON.categoryName); - category.categoryID = categoryAsJSON.id; + category.categoryID = categoryAsJSON.categoryID; return category; } 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 93dd99d..287d4f2 100644 --- a/src/main/resources/static/js/pages/list/frontend/categoryUI.js +++ b/src/main/resources/static/js/pages/list/frontend/categoryUI.js @@ -9,7 +9,7 @@ export function addCategory(categoryAsJSON) { const categorySelect = document.querySelector(".addItemForm__categorySelect"); const newCategoryOption = document.createElement("option"); - newCategoryOption.setAttribute("value", categoryAsJSON.id); + newCategoryOption.setAttribute("value", category.categoryID); newCategoryOption.textContent = category.categoryName; categorySelect.appendChild(newCategoryOption);