]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/api/bulk.ts
Merge branch 'release/5.1.0' into develop
[github/Chocobozzz/PeerTube.git] / server / controllers / api / bulk.ts
index 1fe139c92f3f4571a9b782585f34d4170312254b..51292175bfc31497fd8a993e9bedd9a3a6cb748f 100644 (file)
@@ -1,9 +1,10 @@
-import * as express from 'express'
-import { asyncMiddleware, authenticate } from '../../middlewares'
+import express from 'express'
+import { removeComment } from '@server/lib/video-comment'
 import { bulkRemoveCommentsOfValidator } from '@server/middlewares/validators/bulk'
 import { VideoCommentModel } from '@server/models/video/video-comment'
+import { HttpStatusCode } from '@shared/models'
 import { BulkRemoveCommentsOfBody } from '@shared/models/bulk/bulk-remove-comments-of-body.model'
-import { removeComment } from '@server/lib/video-comment'
+import { asyncMiddleware, authenticate } from '../../middlewares'
 
 const bulkRouter = express.Router()
 
@@ -33,9 +34,9 @@ async function bulkRemoveCommentsOf (req: express.Request, res: express.Response
   const comments = await VideoCommentModel.listForBulkDelete(account, filter)
 
   // Don't wait result
-  res.sendStatus(204)
+  res.status(HttpStatusCode.NO_CONTENT_204).end()
 
   for (const comment of comments) {
-    await removeComment(comment)
+    await removeComment(comment, req, res)
   }
 }