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/controllers/api/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/controllers/api/bulk.ts')
-rw-r--r-- | server/controllers/api/bulk.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/server/controllers/api/bulk.ts b/server/controllers/api/bulk.ts index 1fe139c92..649351029 100644 --- a/server/controllers/api/bulk.ts +++ b/server/controllers/api/bulk.ts | |||
@@ -2,8 +2,9 @@ import * as express from 'express' | |||
2 | import { asyncMiddleware, authenticate } from '../../middlewares' | 2 | import { asyncMiddleware, authenticate } from '../../middlewares' |
3 | import { bulkRemoveCommentsOfValidator } from '@server/middlewares/validators/bulk' | 3 | import { bulkRemoveCommentsOfValidator } from '@server/middlewares/validators/bulk' |
4 | import { VideoCommentModel } from '@server/models/video/video-comment' | 4 | import { VideoCommentModel } from '@server/models/video/video-comment' |
5 | import { BulkRemoveCommentsOfBody } from '@shared/models/bulk/bulk-remove-comments-of-body.model' | ||
6 | import { removeComment } from '@server/lib/video-comment' | 5 | import { removeComment } from '@server/lib/video-comment' |
6 | import { BulkRemoveCommentsOfBody } from '@shared/models/bulk/bulk-remove-comments-of-body.model' | ||
7 | import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' | ||
7 | 8 | ||
8 | const bulkRouter = express.Router() | 9 | const bulkRouter = express.Router() |
9 | 10 | ||
@@ -33,7 +34,7 @@ async function bulkRemoveCommentsOf (req: express.Request, res: express.Response | |||
33 | const comments = await VideoCommentModel.listForBulkDelete(account, filter) | 34 | const comments = await VideoCommentModel.listForBulkDelete(account, filter) |
34 | 35 | ||
35 | // Don't wait result | 36 | // Don't wait result |
36 | res.sendStatus(204) | 37 | res.sendStatus(HttpStatusCode.NO_CONTENT_204) |
37 | 38 | ||
38 | for (const comment of comments) { | 39 | for (const comment of comments) { |
39 | await removeComment(comment) | 40 | await removeComment(comment) |