aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/videos/video-comments.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares/validators/videos/video-comments.ts')
-rw-r--r--server/middlewares/validators/videos/video-comments.ts14
1 files changed, 0 insertions, 14 deletions
diff --git a/server/middlewares/validators/videos/video-comments.ts b/server/middlewares/validators/videos/video-comments.ts
index b2a39617b..69062701b 100644
--- a/server/middlewares/validators/videos/video-comments.ts
+++ b/server/middlewares/validators/videos/video-comments.ts
@@ -43,8 +43,6 @@ const listVideoCommentsValidator = [
43 .custom(exists), 43 .custom(exists),
44 44
45 (req: express.Request, res: express.Response, next: express.NextFunction) => { 45 (req: express.Request, res: express.Response, next: express.NextFunction) => {
46 logger.debug('Checking listVideoCommentsValidator parameters.', { parameters: req.query })
47
48 if (areValidationErrors(req, res)) return 46 if (areValidationErrors(req, res)) return
49 47
50 return next() 48 return next()
@@ -55,8 +53,6 @@ const listVideoCommentThreadsValidator = [
55 isValidVideoIdParam('videoId'), 53 isValidVideoIdParam('videoId'),
56 54
57 async (req: express.Request, res: express.Response, next: express.NextFunction) => { 55 async (req: express.Request, res: express.Response, next: express.NextFunction) => {
58 logger.debug('Checking listVideoCommentThreads parameters.', { parameters: req.params })
59
60 if (areValidationErrors(req, res)) return 56 if (areValidationErrors(req, res)) return
61 if (!await doesVideoExist(req.params.videoId, res, 'only-video')) return 57 if (!await doesVideoExist(req.params.videoId, res, 'only-video')) return
62 58
@@ -73,8 +69,6 @@ const listVideoThreadCommentsValidator = [
73 .custom(isIdValid), 69 .custom(isIdValid),
74 70
75 async (req: express.Request, res: express.Response, next: express.NextFunction) => { 71 async (req: express.Request, res: express.Response, next: express.NextFunction) => {
76 logger.debug('Checking listVideoThreadComments parameters.', { parameters: req.params })
77
78 if (areValidationErrors(req, res)) return 72 if (areValidationErrors(req, res)) return
79 if (!await doesVideoExist(req.params.videoId, res, 'only-video')) return 73 if (!await doesVideoExist(req.params.videoId, res, 'only-video')) return
80 if (!await doesVideoCommentThreadExist(req.params.threadId, res.locals.onlyVideo, res)) return 74 if (!await doesVideoCommentThreadExist(req.params.threadId, res.locals.onlyVideo, res)) return
@@ -92,8 +86,6 @@ const addVideoCommentThreadValidator = [
92 .custom(isValidVideoCommentText), 86 .custom(isValidVideoCommentText),
93 87
94 async (req: express.Request, res: express.Response, next: express.NextFunction) => { 88 async (req: express.Request, res: express.Response, next: express.NextFunction) => {
95 logger.debug('Checking addVideoCommentThread parameters.', { parameters: req.params, body: req.body })
96
97 if (areValidationErrors(req, res)) return 89 if (areValidationErrors(req, res)) return
98 if (!await doesVideoExist(req.params.videoId, res)) return 90 if (!await doesVideoExist(req.params.videoId, res)) return
99 91
@@ -114,8 +106,6 @@ const addVideoCommentReplyValidator = [
114 body('text').custom(isValidVideoCommentText), 106 body('text').custom(isValidVideoCommentText),
115 107
116 async (req: express.Request, res: express.Response, next: express.NextFunction) => { 108 async (req: express.Request, res: express.Response, next: express.NextFunction) => {
117 logger.debug('Checking addVideoCommentReply parameters.', { parameters: req.params, body: req.body })
118
119 if (areValidationErrors(req, res)) return 109 if (areValidationErrors(req, res)) return
120 if (!await doesVideoExist(req.params.videoId, res)) return 110 if (!await doesVideoExist(req.params.videoId, res)) return
121 111
@@ -136,8 +126,6 @@ const videoCommentGetValidator = [
136 .custom(isIdValid), 126 .custom(isIdValid),
137 127
138 async (req: express.Request, res: express.Response, next: express.NextFunction) => { 128 async (req: express.Request, res: express.Response, next: express.NextFunction) => {
139 logger.debug('Checking videoCommentGetValidator parameters.', { parameters: req.params })
140
141 if (areValidationErrors(req, res)) return 129 if (areValidationErrors(req, res)) return
142 if (!await doesVideoExist(req.params.videoId, res, 'id')) return 130 if (!await doesVideoExist(req.params.videoId, res, 'id')) return
143 if (!await doesVideoCommentExist(req.params.commentId, res.locals.videoId, res)) return 131 if (!await doesVideoCommentExist(req.params.commentId, res.locals.videoId, res)) return
@@ -153,8 +141,6 @@ const removeVideoCommentValidator = [
153 .custom(isIdValid), 141 .custom(isIdValid),
154 142
155 async (req: express.Request, res: express.Response, next: express.NextFunction) => { 143 async (req: express.Request, res: express.Response, next: express.NextFunction) => {
156 logger.debug('Checking removeVideoCommentValidator parameters.', { parameters: req.params })
157
158 if (areValidationErrors(req, res)) return 144 if (areValidationErrors(req, res)) return
159 if (!await doesVideoExist(req.params.videoId, res)) return 145 if (!await doesVideoExist(req.params.videoId, res)) return
160 if (!await doesVideoCommentExist(req.params.commentId, res.locals.videoAll, res)) return 146 if (!await doesVideoCommentExist(req.params.commentId, res.locals.videoAll, res)) return