Fixed typos where post-id was instead of category.
This commit is contained in:
parent
33dba32226
commit
63dbef6b37
@ -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");
|
||||
});
|
Loading…
Reference in New Issue
Block a user