ref #356, delete banners and flags

indiachan-spamvector
Thomas Lynch 3 years ago
parent db01644f14
commit b4415ab940
  1. 8
      controllers/forms/deletecustompage.js
  2. 8
      controllers/forms/deleteflags.js

@ -14,11 +14,9 @@ module.exports = {
controller: async (req, res, next) => {
const errors = [];
if (!req.body.checkedcustompages || req.body.checkedcustompages.length === 0) {
errors.push('Must select at least one custom page to delete');
}
const errors = await checkSchema([
{ result: lengthBody(req.body.checkedcustompages, 1), expected: false, error: 'Must select at least one custom page to delete' },
]);
if (errors.length > 0) {
return dynamicResponse(req, res, 400, 'message', {

@ -14,11 +14,9 @@ module.exports = {
controller: async (req, res, next) => {
const errors = [];
if (!req.body.checkedflags || req.body.checkedflags.length === 0) {
errors.push('Must select at least one flag to delete');
}
const errors = await checkSchema([
{ result: lengthBody(req.body.checkedflags, 1), expected: false, error: 'Must select at least one flag to delete' },
]);
if (errors.length > 0) {
return dynamicResponse(req, res, 400, 'message', {

Loading…
Cancel
Save