From 6a32200ce5e50ff5dd2d9a7ef0ac27eac165a6e6 Mon Sep 17 00:00:00 2001 From: Tim Aldinger Date: Fri, 9 Oct 2026 15:42:11 +0200 Subject: [PATCH] implementierung editCategoryFunktion --- src/main/resources/static/js/list/listAPI.js | 11 +++++++++++ 1 file changed, 11 insertions(+) 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" });