diff options
author | Chocobozzz <me@florianbigard.com> | 2019-07-23 10:40:39 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-07-24 10:58:16 +0200 |
commit | 3e753302d8c911b59971c16a8018df0e1ab78465 (patch) | |
tree | efce7ece3273589228c5c948ea6757b2bdf65429 /server/middlewares/validators/videos/video-abuses.ts | |
parent | a8b666e9f1ed002230869606308749614390c82f (diff) | |
download | PeerTube-3e753302d8c911b59971c16a8018df0e1ab78465.tar.gz PeerTube-3e753302d8c911b59971c16a8018df0e1ab78465.tar.zst PeerTube-3e753302d8c911b59971c16a8018df0e1ab78465.zip |
Refactor middleware helpers
Diffstat (limited to 'server/middlewares/validators/videos/video-abuses.ts')
-rw-r--r-- | server/middlewares/validators/videos/video-abuses.ts | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/server/middlewares/validators/videos/video-abuses.ts b/server/middlewares/validators/videos/video-abuses.ts index d1910a992..e176e01af 100644 --- a/server/middlewares/validators/videos/video-abuses.ts +++ b/server/middlewares/validators/videos/video-abuses.ts | |||
@@ -2,15 +2,14 @@ import * as express from 'express' | |||
2 | import 'express-validator' | 2 | import 'express-validator' |
3 | import { body, param } from 'express-validator/check' | 3 | import { body, param } from 'express-validator/check' |
4 | import { isIdOrUUIDValid, isIdValid } from '../../../helpers/custom-validators/misc' | 4 | import { isIdOrUUIDValid, isIdValid } from '../../../helpers/custom-validators/misc' |
5 | import { doesVideoExist } from '../../../helpers/custom-validators/videos' | ||
6 | import { logger } from '../../../helpers/logger' | 5 | import { logger } from '../../../helpers/logger' |
7 | import { areValidationErrors } from '../utils' | 6 | import { areValidationErrors } from '../utils' |
8 | import { | 7 | import { |
9 | doesVideoAbuseExist, | ||
10 | isVideoAbuseModerationCommentValid, | 8 | isVideoAbuseModerationCommentValid, |
11 | isVideoAbuseReasonValid, | 9 | isVideoAbuseReasonValid, |
12 | isVideoAbuseStateValid | 10 | isVideoAbuseStateValid |
13 | } from '../../../helpers/custom-validators/video-abuses' | 11 | } from '../../../helpers/custom-validators/video-abuses' |
12 | import { doesVideoAbuseExist, doesVideoExist } from '../../../helpers/middlewares' | ||
14 | 13 | ||
15 | const videoAbuseReportValidator = [ | 14 | const videoAbuseReportValidator = [ |
16 | param('videoId').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid videoId'), | 15 | param('videoId').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid videoId'), |