X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fcontrollers%2Fapi%2Fbulk.ts;h=62121ece5a2021e5fa273f99656ac0efedb4a040;hb=40e7ed0714f96c01e16de3ac971a4b28116294e1;hp=649351029f1fb569aa12eaf0a0222b262d34bc57;hpb=2d53be0267acc49cda46707b885096193a1f4e9c;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/controllers/api/bulk.ts b/server/controllers/api/bulk.ts index 649351029..62121ece5 100644 --- a/server/controllers/api/bulk.ts +++ b/server/controllers/api/bulk.ts @@ -1,10 +1,10 @@ import * as express from 'express' -import { asyncMiddleware, authenticate } from '../../middlewares' +import { removeComment } from '@server/lib/video-comment' import { bulkRemoveCommentsOfValidator } from '@server/middlewares/validators/bulk' import { VideoCommentModel } from '@server/models/video/video-comment' -import { removeComment } from '@server/lib/video-comment' +import { HttpStatusCode } from '@shared/models' import { BulkRemoveCommentsOfBody } from '@shared/models/bulk/bulk-remove-comments-of-body.model' -import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' +import { asyncMiddleware, authenticate } from '../../middlewares' const bulkRouter = express.Router() @@ -34,7 +34,7 @@ async function bulkRemoveCommentsOf (req: express.Request, res: express.Response const comments = await VideoCommentModel.listForBulkDelete(account, filter) // Don't wait result - res.sendStatus(HttpStatusCode.NO_CONTENT_204) + res.status(HttpStatusCode.NO_CONTENT_204).end() for (const comment of comments) { await removeComment(comment)