2022-11-18 21:35:38 +00:00
|
|
|
function delete_postModal(t, id) {
|
2023-03-10 01:33:05 +00:00
|
|
|
document.getElementById("deletePostButton").addEventListener('click', () => {
|
2022-11-18 21:35:38 +00:00
|
|
|
postToast(t, `/delete_post/${id}`,
|
|
|
|
{
|
|
|
|
},
|
|
|
|
() => {
|
2022-12-30 12:52:59 +00:00
|
|
|
if (location.pathname == '/admin/reported/posts')
|
2022-10-23 16:24:17 +00:00
|
|
|
{
|
|
|
|
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');
|
|
|
|
}
|
2022-07-16 21:00:02 +00:00
|
|
|
}
|
2022-11-18 21:35:38 +00:00
|
|
|
);
|
2023-01-28 14:27:52 +00:00
|
|
|
});
|
2022-10-23 16:24:17 +00:00
|
|
|
}
|