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