aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/videos/comment.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/videos/comment.ts')
-rw-r--r--server/controllers/api/videos/comment.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/server/controllers/api/videos/comment.ts b/server/controllers/api/videos/comment.ts
index 020d0b104..752a33596 100644
--- a/server/controllers/api/videos/comment.ts
+++ b/server/controllers/api/videos/comment.ts
@@ -29,6 +29,7 @@ import {
29} from '../../../middlewares/validators' 29} from '../../../middlewares/validators'
30import { AccountModel } from '../../../models/account/account' 30import { AccountModel } from '../../../models/account/account'
31import { VideoCommentModel } from '../../../models/video/video-comment' 31import { VideoCommentModel } from '../../../models/video/video-comment'
32import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
32 33
33const auditLogger = auditLoggerFactory('comments') 34const auditLogger = auditLoggerFactory('comments')
34const videoCommentRouter = express.Router() 35const videoCommentRouter = express.Router()
@@ -161,7 +162,7 @@ async function listVideoThreadComments (req: express.Request, res: express.Respo
161 } 162 }
162 163
163 if (resultList.data.length === 0) { 164 if (resultList.data.length === 0) {
164 return res.sendStatus(404) 165 return res.sendStatus(HttpStatusCode.NOT_FOUND_404)
165 } 166 }
166 167
167 return res.json(buildFormattedCommentTree(resultList)) 168 return res.json(buildFormattedCommentTree(resultList))
@@ -218,5 +219,7 @@ async function removeVideoComment (req: express.Request, res: express.Response)
218 219
219 auditLogger.delete(getAuditIdFromRes(res), new CommentAuditView(videoCommentInstance.toFormattedJSON())) 220 auditLogger.delete(getAuditIdFromRes(res), new CommentAuditView(videoCommentInstance.toFormattedJSON()))
220 221
221 return res.type('json').status(204).end() 222 return res.type('json')
223 .status(HttpStatusCode.NO_CONTENT_204)
224 .end()
222} 225}