diff options
author | Chocobozzz <me@florianbigard.com> | 2020-11-16 11:55:17 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-11-16 13:48:58 +0100 |
commit | f1273314593a4a7dc7ec9594ce0c6c3ae8f62b34 (patch) | |
tree | cf1f3949e64a24a820833950d7b2bbf9ccd40013 /server/middlewares | |
parent | 0f8d00e3144060270d7fe603865fccaf18649c47 (diff) | |
download | PeerTube-f1273314593a4a7dc7ec9594ce0c6c3ae8f62b34.tar.gz PeerTube-f1273314593a4a7dc7ec9594ce0c6c3ae8f62b34.tar.zst PeerTube-f1273314593a4a7dc7ec9594ce0c6c3ae8f62b34.zip |
Add admin view to manage comments
Diffstat (limited to 'server/middlewares')
-rw-r--r-- | server/middlewares/validators/users.ts | 1 | ||||
-rw-r--r-- | server/middlewares/validators/videos/video-comments.ts | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/server/middlewares/validators/users.ts b/server/middlewares/validators/users.ts index 452c7fb93..c91c378b3 100644 --- a/server/middlewares/validators/users.ts +++ b/server/middlewares/validators/users.ts | |||
@@ -41,6 +41,7 @@ import { Hooks } from '@server/lib/plugins/hooks' | |||
41 | const usersListValidator = [ | 41 | const usersListValidator = [ |
42 | query('blocked') | 42 | query('blocked') |
43 | .optional() | 43 | .optional() |
44 | .customSanitizer(toBooleanOrNull) | ||
44 | .isBoolean().withMessage('Should be a valid boolean banned state'), | 45 | .isBoolean().withMessage('Should be a valid boolean banned state'), |
45 | 46 | ||
46 | (req: express.Request, res: express.Response, next: express.NextFunction) => { | 47 | (req: express.Request, res: express.Response, next: express.NextFunction) => { |
diff --git a/server/middlewares/validators/videos/video-comments.ts b/server/middlewares/validators/videos/video-comments.ts index 55fb60b98..a3c9febc4 100644 --- a/server/middlewares/validators/videos/video-comments.ts +++ b/server/middlewares/validators/videos/video-comments.ts | |||
@@ -2,7 +2,7 @@ import * as express from 'express' | |||
2 | import { body, param, query } from 'express-validator' | 2 | import { body, param, query } from 'express-validator' |
3 | import { MUserAccountUrl } from '@server/types/models' | 3 | import { MUserAccountUrl } from '@server/types/models' |
4 | import { UserRight } from '../../../../shared' | 4 | import { UserRight } from '../../../../shared' |
5 | import { exists, isBooleanValid, isIdOrUUIDValid, isIdValid } from '../../../helpers/custom-validators/misc' | 5 | import { exists, isBooleanValid, isIdOrUUIDValid, isIdValid, toBooleanOrNull } from '../../../helpers/custom-validators/misc' |
6 | import { | 6 | import { |
7 | doesVideoCommentExist, | 7 | doesVideoCommentExist, |
8 | doesVideoCommentThreadExist, | 8 | doesVideoCommentThreadExist, |
@@ -18,6 +18,7 @@ import { areValidationErrors } from '../utils' | |||
18 | const listVideoCommentsValidator = [ | 18 | const listVideoCommentsValidator = [ |
19 | query('isLocal') | 19 | query('isLocal') |
20 | .optional() | 20 | .optional() |
21 | .customSanitizer(toBooleanOrNull) | ||
21 | .custom(isBooleanValid) | 22 | .custom(isBooleanValid) |
22 | .withMessage('Should have a valid is local boolean'), | 23 | .withMessage('Should have a valid is local boolean'), |
23 | 24 | ||