Worked ban frontend and api.

This commit is contained in:
rainbow napkin 2024-11-29 08:00:25 -05:00
parent 5c936462a6
commit c848994c1d
18 changed files with 513 additions and 41 deletions

View file

@ -15,7 +15,7 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.*/
//npm imports
const { checkExact } = require('express-validator');
const { body, checkExact} = require('express-validator');
const { Router } = require('express');
@ -42,6 +42,8 @@ router.get('/permissions', permissionsController.get);
router.post('/permissions', checkExact([permissionsValidator.permissionsMap(), channelPermissionValidator.channelPermissionsMap()]), permissionsController.post);
router.post('/changeRank', accountValidator.user(), accountValidator.rank(), changeRankController.post);
router.get('/ban', banController.get);
router.post('/ban', accountValidator.user(), banController.post);
//Sometimes they're so simple you don't need to put your validators in their own special place :P
router.post('/ban', accountValidator.user(), body("permanent").isBoolean(), body("expirationDays").isInt(), banController.post);
router.delete('/ban', accountValidator.user(), banController.delete);
module.exports = router;