feat: add confirm to reject, closes #10427

isekai-main
Barış Soner Uşaklı 3 years ago
parent 56db0b56ab
commit 538ad9e18b

@ -17,5 +17,6 @@
"reject": "Reject",
"remove": "Remove",
"notify": "Notify",
"notify-user": "Notify User"
"notify-user": "Notify User",
"confirm-reject": "Do you want to reject this post?"
}

@ -33,12 +33,17 @@ define('forum/post-queue', [
});
});
}
function confirmReject() {
return new Promise((resolve) => {
bootbox.confirm('[[post-queue:confirm-reject]]', resolve);
});
}
const parent = $(this).parents('[data-id]');
const action = $(this).attr('data-action');
const id = parent.attr('data-id');
const listContainer = parent.get(0).parentNode;
if (!['accept', 'reject', 'notify'].includes(action)) {
if ((!['accept', 'reject', 'notify'].includes(action)) || (action === 'reject' && !await confirmReject())) {
return;
}

Loading…
Cancel
Save