mirror of
https://github.com/luxfi/pics.git
synced 2026-10-30 15:22:15 +00:00
Add tests for editing ban duration, note, and unban on board level to catch this
17 lines
499 B
JavaScript
17 lines
499 B
JavaScript
'use strict';
|
|
|
|
const { Bans } = require(__dirname+'/../../db/')
|
|
, { Permissions } = require(__dirname+'/../../lib/permission/permissions.js');
|
|
|
|
module.exports = async (req, res) => {
|
|
|
|
const showGlobal = res.locals.permissions.get(Permissions.VIEW_BOARD_GLOBAL_BANS);
|
|
const bansBoard = req.params && req.params.board
|
|
? (showGlobal
|
|
? req.params.board
|
|
: { '$eq': req.params.board })
|
|
: null;
|
|
return Bans.removeMany(bansBoard, req.body.checkedbans).then(result => result.deletedCount);
|
|
|
|
};
|