mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-01 21:30:30 +01:00
feat: add confirm to reject, closes #10427
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user