forked from rDrama/rDrama
24 lines
742 B
JavaScript
24 lines
742 B
JavaScript
function delete_postModal(t, id) {
|
|
document.getElementById("deletePostButton").addEventListener('click', () => {
|
|
postToast(t, `/delete_post/${id}`,
|
|
{
|
|
},
|
|
() => {
|
|
if (location.pathname == '/admin/reported/posts')
|
|
{
|
|
document.getElementById("flaggers-"+id).remove()
|
|
document.getElementById("post-"+id).remove()
|
|
}
|
|
else
|
|
{
|
|
document.getElementById(`post-${id}`).classList.add('deleted');
|
|
document.getElementById(`delete-${id}`).classList.add('d-none');
|
|
document.getElementById(`undelete-${id}`).classList.remove('d-none');
|
|
document.getElementById(`delete2-${id}`).classList.add('d-none');
|
|
document.getElementById(`undelete2-${id}`).classList.remove('d-none');
|
|
}
|
|
}
|
|
);
|
|
});
|
|
}
|