Implemented reply deleting. But updating doesn't work yet.
This commit is contained in:
parent
fbededb796
commit
37c56a91b6
@ -24,6 +24,12 @@ for (const delete_entry_button of document.getElementsByName("delete-entry"))
|
|||||||
// EDIT REPLY
|
// EDIT REPLY
|
||||||
|
|
||||||
function edit_reply(e) {
|
function edit_reply(e) {
|
||||||
|
let data = new URLSearchParams();
|
||||||
|
data.append("entry_id", e.target.form[0].value);
|
||||||
|
data.append("message", e.target.form[1].value);
|
||||||
|
fetch("/guestbook/admin/reply/?update", {method: "POST", body: data})
|
||||||
|
.catch(e => console.log(e))
|
||||||
|
.then(() => window.location = "/guestbook/admin");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const edit_reply_button of document.getElementsByName("edit-reply"))
|
for (const edit_reply_button of document.getElementsByName("edit-reply"))
|
||||||
@ -43,6 +49,12 @@ for (const delete_reply_button of document.getElementsByName("delete-reply"))
|
|||||||
// NEW REPLY
|
// NEW REPLY
|
||||||
|
|
||||||
function send_reply(e) {
|
function send_reply(e) {
|
||||||
|
let data = new URLSearchParams();
|
||||||
|
data.append("entry_id", e.target.form[0].value);
|
||||||
|
data.append("message", e.target.form[1].value);
|
||||||
|
fetch("/guestbook/admin/reply/", {method: "POST", body: data})
|
||||||
|
.catch(e => console.log(e))
|
||||||
|
.then(() => window.location = "/guestbook/admin");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const reply_button of document.getElementsByName("reply"))
|
for (const reply_button of document.getElementsByName("reply"))
|
||||||
|
Loading…
Reference in New Issue
Block a user