1
0

Implemented reply deleting. But updating doesn't work yet.

This commit is contained in:
Alexander Andreev 2023-02-06 02:42:42 +04:00
parent fbededb796
commit 37c56a91b6
Signed by: Arav
GPG Key ID: 0388CC8FAA51063F

View File

@ -24,6 +24,12 @@ for (const delete_entry_button of document.getElementsByName("delete-entry"))
// EDIT REPLY
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"))
@ -43,6 +49,12 @@ for (const delete_reply_button of document.getElementsByName("delete-reply"))
// NEW REPLY
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"))