aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares/validators')
-rw-r--r--server/middlewares/validators/users.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/middlewares/validators/users.ts b/server/middlewares/validators/users.ts
index 94d8ab53b..771c414a0 100644
--- a/server/middlewares/validators/users.ts
+++ b/server/middlewares/validators/users.ts
@@ -5,7 +5,7 @@ import { body, param } from 'express-validator/check'
5import { omit } from 'lodash' 5import { omit } from 'lodash'
6import { isIdOrUUIDValid } from '../../helpers/custom-validators/misc' 6import { isIdOrUUIDValid } from '../../helpers/custom-validators/misc'
7import { 7import {
8 isUserAutoPlayVideoValid, 8 isUserAutoPlayVideoValid, isUserBlockedReasonValid,
9 isUserDescriptionValid, 9 isUserDescriptionValid,
10 isUserDisplayNameValid, 10 isUserDisplayNameValid,
11 isUserNSFWPolicyValid, 11 isUserNSFWPolicyValid,
@@ -76,9 +76,10 @@ const usersRemoveValidator = [
76 76
77const usersBlockingValidator = [ 77const usersBlockingValidator = [
78 param('id').isInt().not().isEmpty().withMessage('Should have a valid id'), 78 param('id').isInt().not().isEmpty().withMessage('Should have a valid id'),
79 body('reason').optional().custom(isUserBlockedReasonValid).withMessage('Should have a valid blocking reason'),
79 80
80 async (req: express.Request, res: express.Response, next: express.NextFunction) => { 81 async (req: express.Request, res: express.Response, next: express.NextFunction) => {
81 logger.debug('Checking usersRemove parameters', { parameters: req.params }) 82 logger.debug('Checking usersBlocking parameters', { parameters: req.params })
82 83
83 if (areValidationErrors(req, res)) return 84 if (areValidationErrors(req, res)) return
84 if (!await checkUserIdExist(req.params.id, res)) return 85 if (!await checkUserIdExist(req.params.id, res)) return