1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-06 03:50:26 +02:00

Use raw sql for comments

This commit is contained in:
Chocobozzz 2023-01-05 15:31:51 +01:00
parent 458685e0d0
commit cde3d90ded
No known key found for this signature in database
GPG key ID: 583A612D890159BE
9 changed files with 624 additions and 378 deletions

View file

@ -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<VideoCommentModel>
let resultList: ThreadsResultList<MCommentFormattable>
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<VideoCommentModel>
let resultList: ResultList<MCommentFormattable>
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')