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;
|
confirmBtn.disabled = false;
|
||||||
} else {
|
} else {
|
||||||
closeModal();
|
closeModal();
|
||||||
window.location.href = '/random';
|
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
alert('Error: ' + e); // Or e.message
|
alert('Error: ' + e); // Or e.message
|
||||||
|
|||||||
@@ -282,13 +282,11 @@ export default (router, tpl) => {
|
|||||||
const id = +req.url.qs.id;
|
const id = +req.url.qs.id;
|
||||||
console.log(`[ADMIN DENY] Denying ID: ${id}`);
|
console.log(`[ADMIN DENY] Denying ID: ${id}`);
|
||||||
await deleteItem(id);
|
await deleteItem(id);
|
||||||
return res.writeHead(302, {
|
return res.reply({ success: true });
|
||||||
"Location": `/admin/approve`
|
|
||||||
}).end();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('[ADMIN DENY] No ID provided');
|
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) => {
|
router.post(/^\/admin\/deny-multi\/?/, lib.auth, async (req, res) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user