aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares')
-rw-r--r--server/middlewares/validators/users.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/server/middlewares/validators/users.ts b/server/middlewares/validators/users.ts
index eceded1c4..6d8cd7894 100644
--- a/server/middlewares/validators/users.ts
+++ b/server/middlewares/validators/users.ts
@@ -5,6 +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 isUserAdminFlagsValid,
8 isUserAutoPlayVideoValid, 9 isUserAutoPlayVideoValid,
9 isUserBlockedReasonValid, 10 isUserBlockedReasonValid,
10 isUserDescriptionValid, 11 isUserDescriptionValid,
@@ -32,6 +33,7 @@ const usersAddValidator = [
32 body('videoQuota').custom(isUserVideoQuotaValid).withMessage('Should have a valid user quota'), 33 body('videoQuota').custom(isUserVideoQuotaValid).withMessage('Should have a valid user quota'),
33 body('videoQuotaDaily').custom(isUserVideoQuotaDailyValid).withMessage('Should have a valid daily user quota'), 34 body('videoQuotaDaily').custom(isUserVideoQuotaDailyValid).withMessage('Should have a valid daily user quota'),
34 body('role').custom(isUserRoleValid).withMessage('Should have a valid role'), 35 body('role').custom(isUserRoleValid).withMessage('Should have a valid role'),
36 body('adminFlags').optional().custom(isUserAdminFlagsValid).withMessage('Should have a valid admin flags'),
35 37
36 async (req: express.Request, res: express.Response, next: express.NextFunction) => { 38 async (req: express.Request, res: express.Response, next: express.NextFunction) => {
37 logger.debug('Checking usersAdd parameters', { parameters: omit(req.body, 'password') }) 39 logger.debug('Checking usersAdd parameters', { parameters: omit(req.body, 'password') })
@@ -120,6 +122,7 @@ const usersUpdateValidator = [
120 body('videoQuota').optional().custom(isUserVideoQuotaValid).withMessage('Should have a valid user quota'), 122 body('videoQuota').optional().custom(isUserVideoQuotaValid).withMessage('Should have a valid user quota'),
121 body('videoQuotaDaily').optional().custom(isUserVideoQuotaDailyValid).withMessage('Should have a valid daily user quota'), 123 body('videoQuotaDaily').optional().custom(isUserVideoQuotaDailyValid).withMessage('Should have a valid daily user quota'),
122 body('role').optional().custom(isUserRoleValid).withMessage('Should have a valid role'), 124 body('role').optional().custom(isUserRoleValid).withMessage('Should have a valid role'),
125 body('adminFlags').optional().custom(isUserAdminFlagsValid).withMessage('Should have a valid admin flags'),
123 126
124 async (req: express.Request, res: express.Response, next: express.NextFunction) => { 127 async (req: express.Request, res: express.Response, next: express.NextFunction) => {
125 logger.debug('Checking usersUpdate parameters', { parameters: req.body }) 128 logger.debug('Checking usersUpdate parameters', { parameters: req.body })