implementierung editCategoryFunktion
This commit is contained in:
1 parent
a7d94868f7
commit
6a32200ce5
1 file changed
+11
@@ -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" });
|
||||
|
||||
|
||||
Reference in new issue
Block a user