diff --git a/src/main/resources/static/js/list/listAPI.js b/src/main/resources/static/js/list/listAPI.js index bf238ac..843c1aa 100644 --- a/src/main/resources/static/js/list/listAPI.js +++ b/src/main/resources/static/js/list/listAPI.js @@ -51,6 +51,17 @@ export async function addCategory(listID, categoryName) { } +export async function editCategory(categoryID, toChange) { + const response = await fetch(`/api/category/${categoryID}`, + { + method: "PATCH", + body: JSON.stringify(toChange), + headers: { "Content-Type": "application/json" } + }); + + return response; +} + export async function deleteCategory(deleteAllItems, categoryID) { const response = await fetch(`/api/category/${categoryID}?deleteAllItems=${deleteAllItems}`, { method: "DELETE" });