aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/bulk.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares/validators/bulk.ts')
-rw-r--r--server/middlewares/validators/bulk.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/server/middlewares/validators/bulk.ts b/server/middlewares/validators/bulk.ts
index f9b0f565a..cfb16d352 100644
--- a/server/middlewares/validators/bulk.ts
+++ b/server/middlewares/validators/bulk.ts
@@ -6,6 +6,7 @@ import { UserRight } from '@shared/models'
6import { BulkRemoveCommentsOfBody } from '@shared/models/bulk/bulk-remove-comments-of-body.model' 6import { BulkRemoveCommentsOfBody } from '@shared/models/bulk/bulk-remove-comments-of-body.model'
7import { logger } from '../../helpers/logger' 7import { logger } from '../../helpers/logger'
8import { areValidationErrors } from './utils' 8import { areValidationErrors } from './utils'
9import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes'
9 10
10const bulkRemoveCommentsOfValidator = [ 11const bulkRemoveCommentsOfValidator = [
11 body('accountName').exists().withMessage('Should have an account name with host'), 12 body('accountName').exists().withMessage('Should have an account name with host'),
@@ -22,7 +23,7 @@ const bulkRemoveCommentsOfValidator = [
22 const body = req.body as BulkRemoveCommentsOfBody 23 const body = req.body as BulkRemoveCommentsOfBody
23 24
24 if (body.scope === 'instance' && user.hasRight(UserRight.REMOVE_ANY_VIDEO_COMMENT) !== true) { 25 if (body.scope === 'instance' && user.hasRight(UserRight.REMOVE_ANY_VIDEO_COMMENT) !== true) {
25 return res.status(403) 26 return res.status(HttpStatusCode.FORBIDDEN_403)
26 .json({ 27 .json({
27 error: 'User cannot remove any comments of this instance.' 28 error: 'User cannot remove any comments of this instance.'
28 }) 29 })