merge-requests/218/head
Thomas Lynch 3 years ago
parent d0f856ab00
commit f93b270b62
  1. 5
      controllers/forms/actions.js
  2. 4
      controllers/forms/globalactions.js

@ -21,12 +21,15 @@ module.exports = async (req, res, next) => {
&& req.body.checkedposts.length > globalLimits.multiInputs.posts.staff) {
errors.push(`Must not select >${globalLimits.multiInputs.posts.staff} posts per request`);
}
//checked reports
if (req.body.checkedreports) {
if (!req.body.report_ban) {
errors.push('Must select a report action if checked reports');
}
if (req.body.checkedreports.length > req.body.checkedposts.length*5) {
if (!req.body.checkedposts) {
errors.push('Must check parent post if checking reports for report action');
} else if (req.body.checkedreports.length > req.body.checkedposts.length*5) {
//5 reports max per post
errors.push('Invalid number of reports checked');
}

@ -23,7 +23,9 @@ module.exports = async (req, res, next) => {
if (!req.body.global_report_ban) {
errors.push('Must select a report action if checked reports');
}
if (req.body.checkedreports.length > req.body.globalcheckedposts.length*5) {
if (!req.body.globalcheckedposts) {
errors.push('Must check parent post if checking reports for report action');
} else if (req.body.checkedreports.length > req.body.globalcheckedposts.length*5) {
//5 reports max per post
errors.push('Invalid number of reports checked');
}

Loading…
Cancel
Save