diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-12-07 14:32:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-07 14:32:36 +0100 |
commit | 2d53be0267acc49cda46707b885096193a1f4e9c (patch) | |
tree | 887061a34bc67f40acbb96a6278f9544bf83caeb /server/middlewares/validators/bulk.ts | |
parent | adc1f09c0dbd997f34028c1c82d1c118dc8ead80 (diff) | |
download | PeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.tar.gz PeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.tar.zst PeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.zip |
replace numbers with typed http status codes (#3409)
Diffstat (limited to 'server/middlewares/validators/bulk.ts')
-rw-r--r-- | server/middlewares/validators/bulk.ts | 3 |
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' | |||
6 | import { BulkRemoveCommentsOfBody } from '@shared/models/bulk/bulk-remove-comments-of-body.model' | 6 | import { BulkRemoveCommentsOfBody } from '@shared/models/bulk/bulk-remove-comments-of-body.model' |
7 | import { logger } from '../../helpers/logger' | 7 | import { logger } from '../../helpers/logger' |
8 | import { areValidationErrors } from './utils' | 8 | import { areValidationErrors } from './utils' |
9 | import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' | ||
9 | 10 | ||
10 | const bulkRemoveCommentsOfValidator = [ | 11 | const 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 | }) |