feat: Add scripts for generating dummy data and copying thumbnails, and update admin deny routes to return JSON responses instead of redirects.
This commit is contained in:
@@ -216,7 +216,6 @@
|
||||
confirmBtn.disabled = false;
|
||||
} else {
|
||||
closeModal();
|
||||
window.location.href = '/random';
|
||||
}
|
||||
} catch (e) {
|
||||
alert('Error: ' + e); // Or e.message
|
||||
|
||||
@@ -282,13 +282,11 @@ export default (router, tpl) => {
|
||||
const id = +req.url.qs.id;
|
||||
console.log(`[ADMIN DENY] Denying ID: ${id}`);
|
||||
await deleteItem(id);
|
||||
return res.writeHead(302, {
|
||||
"Location": `/admin/approve`
|
||||
}).end();
|
||||
return res.reply({ success: true });
|
||||
}
|
||||
|
||||
console.log('[ADMIN DENY] No ID provided');
|
||||
return res.writeHead(302, { "Location": "/admin/approve" }).end();
|
||||
return res.reply({ success: false, msg: "No ID provided" });
|
||||
});
|
||||
|
||||
router.post(/^\/admin\/deny-multi\/?/, lib.auth, async (req, res) => {
|
||||
|
||||
Reference in New Issue
Block a user