bug: categoryID war noch id
This commit is contained in:
1 parent
4d69c8167a
commit
7202eea4cc
2 files changed
+2
-2
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user