fix delete post and delete comment modals

This commit is contained in:
justcool393 2023-07-26 12:04:12 -05:00
parent eb5a0acb5e
commit a628d59c03
2 changed files with 4 additions and 4 deletions

View file

@ -87,7 +87,7 @@ function toggleEdit(id){
function delete_commentModal(id) {
document.getElementById("deleteCommentButton").onclick = postToast(null, `/delete/comment/${id}`, 'POST', null, (xhr) => {
document.getElementById("deleteCommentButton").onclick = () => { postToast(null, `/delete/comment/${id}`, 'POST', null, (xhr) => {
if (xhr.status >= 200 && xhr.status < 300) {
document.getElementsByClassName(`comment-${id}-only`)[0].classList.add('deleted');
document.getElementById(`delete-${id}`).classList.add('d-none');
@ -95,7 +95,7 @@ function delete_commentModal(id) {
document.getElementById(`delete2-${id}`).classList.add('d-none');
document.getElementById(`undelete2-${id}`).classList.remove('d-none');
}
});
})};
}
function post_reply(id){

View file

@ -1,5 +1,5 @@
function delete_postModal(id) {
document.getElementById("deletePostButton").onclick = postToast(null, `/delete_post/${id}`, 'POST', null, (xhr) => {
document.getElementById("deletePostButton").onclick = () => postToast(null, `/delete_post/${id}`, 'POST', null, (xhr) => {
if (xhr.status >= 200 && xhr.status < 300) {
document.getElementById(`post-${id}`).classList.add('deleted');
document.getElementById(`delete-${id}`).classList.add('d-none');
@ -7,5 +7,5 @@ function delete_postModal(id) {
document.getElementById(`delete2-${id}`).classList.add('d-none');
document.getElementById(`undelete2-${id}`).classList.remove('d-none');
}
});
})};
}