From cde3d90ded5debb24281a444eabb720b721e5600 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 5 Jan 2023 15:31:51 +0100 Subject: Use raw sql for comments --- server/controllers/api/videos/comment.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'server/controllers/api/videos') diff --git a/server/controllers/api/videos/comment.ts b/server/controllers/api/videos/comment.ts index 44d64776c..70ca21500 100644 --- a/server/controllers/api/videos/comment.ts +++ b/server/controllers/api/videos/comment.ts @@ -1,4 +1,6 @@ +import { MCommentFormattable } from '@server/types/models' import express from 'express' + import { ResultList, ThreadsResultList, UserRight, VideoCommentCreate } from '../../../../shared/models' import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' import { VideoCommentThreads } from '../../../../shared/models/videos/comment/video-comment.model' @@ -109,7 +111,7 @@ async function listVideoThreads (req: express.Request, res: express.Response) { const video = res.locals.onlyVideo const user = res.locals.oauth ? res.locals.oauth.token.User : undefined - let resultList: ThreadsResultList + let resultList: ThreadsResultList if (video.commentsEnabled === true) { const apiOptions = await Hooks.wrapObject({ @@ -144,12 +146,11 @@ async function listVideoThreadComments (req: express.Request, res: express.Respo const video = res.locals.onlyVideo const user = res.locals.oauth ? res.locals.oauth.token.User : undefined - let resultList: ResultList + let resultList: ResultList if (video.commentsEnabled === true) { const apiOptions = await Hooks.wrapObject({ videoId: video.id, - isVideoOwned: video.isOwned(), threadId: res.locals.videoCommentThread.id, user }, 'filter:api.video-thread-comments.list.params') -- cgit v1.2.3