1
0

Fixed typos where post-id was instead of category.

This commit is contained in:
Alexander Andreev 2023-05-23 02:44:10 +04:00
parent 33dba32226
commit 63dbef6b37
Signed by: Arav
GPG Key ID: D22A817D95815393

View File

@ -37,13 +37,13 @@ document.getElementById("manage-categories").elements["add"].addEventListener("c
document.getElementById("manage-categories").elements["edit"].addEventListener("click", ev => {
let data = new URLSearchParams();
data.append("name", get_field(ev.target, "name"));
fetch(`/api/mindflow-category/${get_field(e.target, "post-id")}`, {method: "PATCH", body: data})
fetch(`/api/mindflow-category/${get_field(ev.target, "category")}`, {method: "PATCH", body: data})
.catch(e => console.log(e))
.then(() => window.location = "/mindflow/admin");
});
document.getElementById("manage-categories").elements["delete"].addEventListener("click", ev => {
fetch(`/api/mindflow-category/${get_field(e.target, "post-id")}`, {method: "DELETE"})
fetch(`/api/mindflow-category/${get_field(ev.target, "category")}`, {method: "DELETE"})
.catch(e => console.log(e))
.then(() => window.location = "/mindflow/admin");
});