Files
pics/models/forms/editbanduration.js
Thomas Lynch 4014c596b3 Add permission for whether role/user can view global bans on board
Change board query to prevent board staff unban/upgrade/delete/etc global bans
Dont add modlog entry for 0 amount ban edits
2024-05-04 18:33:17 +10:00

12 lines
395 B
JavaScript

'use strict';
const { Bans } = require(__dirname+'/../../db/');
module.exports = async (req, res) => {
//New ban expiry date is current date + ban_duration. Not based on the original ban issue date.
const newExpireAt = new Date(Date.now() + req.body.ban_duration);
return Bans.editDuration(res.locals.bansBoard, req.body.checkedbans, newExpireAt).then(result => result.modifiedCount);
};