diff options
author | Chocobozzz <me@florianbigard.com> | 2020-05-28 11:15:38 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-05-29 09:32:12 +0200 |
commit | 72c33e716fecd1826dcf645957f8669821f91ff3 (patch) | |
tree | 31d270c2afc2f07303fa491189d6b6b1c0ea8bb1 /server/middlewares/validators/config.ts | |
parent | 8adf0a767f0816465ac3a8f4a6c63f53dd05fe3d (diff) | |
download | PeerTube-72c33e716fecd1826dcf645957f8669821f91ff3.tar.gz PeerTube-72c33e716fecd1826dcf645957f8669821f91ff3.tar.zst PeerTube-72c33e716fecd1826dcf645957f8669821f91ff3.zip |
Support broadcast messages
Diffstat (limited to 'server/middlewares/validators/config.ts')
-rw-r--r-- | server/middlewares/validators/config.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/server/middlewares/validators/config.ts b/server/middlewares/validators/config.ts index dfa549e76..6905ac762 100644 --- a/server/middlewares/validators/config.ts +++ b/server/middlewares/validators/config.ts | |||
@@ -55,6 +55,11 @@ const customConfigUpdateValidator = [ | |||
55 | 55 | ||
56 | body('theme.default').custom(v => isThemeNameValid(v) && isThemeRegistered(v)).withMessage('Should have a valid theme'), | 56 | body('theme.default').custom(v => isThemeNameValid(v) && isThemeRegistered(v)).withMessage('Should have a valid theme'), |
57 | 57 | ||
58 | body('broadcastMessage.enabled').isBoolean().withMessage('Should have a valid broadcast message enabled boolean'), | ||
59 | body('broadcastMessage.message').exists().withMessage('Should have a valid broadcast message'), | ||
60 | body('broadcastMessage.level').exists().withMessage('Should have a valid broadcast level'), | ||
61 | body('broadcastMessage.dismissable').exists().withMessage('Should have a valid broadcast dismissable boolean'), | ||
62 | |||
58 | (req: express.Request, res: express.Response, next: express.NextFunction) => { | 63 | (req: express.Request, res: express.Response, next: express.NextFunction) => { |
59 | logger.debug('Checking customConfigUpdateValidator parameters', { parameters: req.body }) | 64 | logger.debug('Checking customConfigUpdateValidator parameters', { parameters: req.body }) |
60 | 65 | ||