aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-09-24 10:19:55 +0200
committerChocobozzz <me@florianbigard.com>2019-09-24 10:19:55 +0200
commitc1e5bd23d557976ba11f89c53a00c1657a7ea890 (patch)
treeea6c3808a00122d77237418b125b512f3ad2626e /server/middlewares
parent6aa541481390980f9c85d2e66514ba0e6ce77a35 (diff)
downloadPeerTube-c1e5bd23d557976ba11f89c53a00c1657a7ea890.tar.gz
PeerTube-c1e5bd23d557976ba11f89c53a00c1657a7ea890.tar.zst
PeerTube-c1e5bd23d557976ba11f89c53a00c1657a7ea890.zip
Try to fix tests
Diffstat (limited to 'server/middlewares')
-rw-r--r--server/middlewares/validators/users.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/server/middlewares/validators/users.ts b/server/middlewares/validators/users.ts
index 871233afe..b3466333c 100644
--- a/server/middlewares/validators/users.ts
+++ b/server/middlewares/validators/users.ts
@@ -4,8 +4,10 @@ import { body, param } from 'express-validator'
4import { omit } from 'lodash' 4import { omit } from 'lodash'
5import { isIdOrUUIDValid, toBooleanOrNull, toIntOrNull } from '../../helpers/custom-validators/misc' 5import { isIdOrUUIDValid, toBooleanOrNull, toIntOrNull } from '../../helpers/custom-validators/misc'
6import { 6import {
7 isNoInstanceConfigWarningModal, isNoWelcomeModal, 7 isNoInstanceConfigWarningModal,
8 isNoWelcomeModal,
8 isUserAdminFlagsValid, 9 isUserAdminFlagsValid,
10 isUserAutoPlayNextVideoValid,
9 isUserAutoPlayVideoValid, 11 isUserAutoPlayVideoValid,
10 isUserBlockedReasonValid, 12 isUserBlockedReasonValid,
11 isUserDescriptionValid, 13 isUserDescriptionValid,
@@ -223,6 +225,9 @@ const usersUpdateMeValidator = [
223 body('noWelcomeModal') 225 body('noWelcomeModal')
224 .optional() 226 .optional()
225 .custom(v => isNoWelcomeModal(v)).withMessage('Should have a valid noWelcomeModal boolean'), 227 .custom(v => isNoWelcomeModal(v)).withMessage('Should have a valid noWelcomeModal boolean'),
228 body('autoPlayNextVideo')
229 .optional()
230 .custom(v => isUserAutoPlayNextVideoValid(v)).withMessage('Should have a valid autoPlayNextVideo boolean'),
226 231
227 async (req: express.Request, res: express.Response, next: express.NextFunction) => { 232 async (req: express.Request, res: express.Response, next: express.NextFunction) => {
228 logger.debug('Checking usersUpdateMe parameters', { parameters: omit(req.body, 'password') }) 233 logger.debug('Checking usersUpdateMe parameters', { parameters: omit(req.body, 'password') })