diff options
Diffstat (limited to 'server/middlewares/validators/videos/video-blacklist.ts')
-rw-r--r-- | server/middlewares/validators/videos/video-blacklist.ts | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/server/middlewares/validators/videos/video-blacklist.ts b/server/middlewares/validators/videos/video-blacklist.ts index f065f101c..6b9aea07c 100644 --- a/server/middlewares/validators/videos/video-blacklist.ts +++ b/server/middlewares/validators/videos/video-blacklist.ts | |||
@@ -3,15 +3,12 @@ import { body, query } from 'express-validator' | |||
3 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | 3 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' |
4 | import { isBooleanValid, toBooleanOrNull, toIntOrNull } from '../../../helpers/custom-validators/misc' | 4 | import { isBooleanValid, toBooleanOrNull, toIntOrNull } from '../../../helpers/custom-validators/misc' |
5 | import { isVideoBlacklistReasonValid, isVideoBlacklistTypeValid } from '../../../helpers/custom-validators/video-blacklist' | 5 | import { isVideoBlacklistReasonValid, isVideoBlacklistTypeValid } from '../../../helpers/custom-validators/video-blacklist' |
6 | import { logger } from '../../../helpers/logger' | ||
7 | import { areValidationErrors, doesVideoBlacklistExist, doesVideoExist, isValidVideoIdParam } from '../shared' | 6 | import { areValidationErrors, doesVideoBlacklistExist, doesVideoExist, isValidVideoIdParam } from '../shared' |
8 | 7 | ||
9 | const videosBlacklistRemoveValidator = [ | 8 | const videosBlacklistRemoveValidator = [ |
10 | isValidVideoIdParam('videoId'), | 9 | isValidVideoIdParam('videoId'), |
11 | 10 | ||
12 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 11 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
13 | logger.debug('Checking blacklistRemove parameters.', { parameters: req.params }) | ||
14 | |||
15 | if (areValidationErrors(req, res)) return | 12 | if (areValidationErrors(req, res)) return |
16 | if (!await doesVideoExist(req.params.videoId, res)) return | 13 | if (!await doesVideoExist(req.params.videoId, res)) return |
17 | if (!await doesVideoBlacklistExist(res.locals.videoAll.id, res)) return | 14 | if (!await doesVideoBlacklistExist(res.locals.videoAll.id, res)) return |
@@ -32,8 +29,6 @@ const videosBlacklistAddValidator = [ | |||
32 | .custom(isVideoBlacklistReasonValid), | 29 | .custom(isVideoBlacklistReasonValid), |
33 | 30 | ||
34 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 31 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
35 | logger.debug('Checking videosBlacklistAdd parameters', { parameters: req.params }) | ||
36 | |||
37 | if (areValidationErrors(req, res)) return | 32 | if (areValidationErrors(req, res)) return |
38 | if (!await doesVideoExist(req.params.videoId, res)) return | 33 | if (!await doesVideoExist(req.params.videoId, res)) return |
39 | 34 | ||
@@ -57,8 +52,6 @@ const videosBlacklistUpdateValidator = [ | |||
57 | .custom(isVideoBlacklistReasonValid).withMessage('Should have a valid reason'), | 52 | .custom(isVideoBlacklistReasonValid).withMessage('Should have a valid reason'), |
58 | 53 | ||
59 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 54 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
60 | logger.debug('Checking videosBlacklistUpdate parameters', { parameters: req.params }) | ||
61 | |||
62 | if (areValidationErrors(req, res)) return | 55 | if (areValidationErrors(req, res)) return |
63 | if (!await doesVideoExist(req.params.videoId, res)) return | 56 | if (!await doesVideoExist(req.params.videoId, res)) return |
64 | if (!await doesVideoBlacklistExist(res.locals.videoAll.id, res)) return | 57 | if (!await doesVideoBlacklistExist(res.locals.videoAll.id, res)) return |
@@ -78,8 +71,6 @@ const videosBlacklistFiltersValidator = [ | |||
78 | .isEmpty().withMessage('Should have a valid search'), | 71 | .isEmpty().withMessage('Should have a valid search'), |
79 | 72 | ||
80 | (req: express.Request, res: express.Response, next: express.NextFunction) => { | 73 | (req: express.Request, res: express.Response, next: express.NextFunction) => { |
81 | logger.debug('Checking videos blacklist filters query', { parameters: req.query }) | ||
82 | |||
83 | if (areValidationErrors(req, res)) return | 74 | if (areValidationErrors(req, res)) return |
84 | 75 | ||
85 | return next() | 76 | return next() |