From 2a021e6cb6836864bb013d5ff451e8a4ae45c9b7 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 19 Feb 2021 10:52:31 +0100 Subject: Fix thread replies API response --- server/models/video/video-comment.ts | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'server/models') diff --git a/server/models/video/video-comment.ts b/server/models/video/video-comment.ts index cfd1d5b7a..dc7556d44 100644 --- a/server/models/video/video-comment.ts +++ b/server/models/video/video-comment.ts @@ -483,20 +483,26 @@ export class VideoCommentModel extends Model { order: [ [ 'createdAt', 'ASC' ], [ 'updatedAt', 'ASC' ] ] as Order, where: { videoId, - [Op.or]: [ - { id: threadId }, - { originCommentId: threadId } - ], - [Op.or]: [ + [Op.and]: [ { - accountId: { - [Op.notIn]: Sequelize.literal( - '(' + buildBlockedAccountSQL(blockerAccountIds) + ')' - ) - } + [Op.or]: [ + { id: threadId }, + { originCommentId: threadId } + ] }, { - accountId: null + [Op.or]: [ + { + accountId: { + [Op.notIn]: Sequelize.literal( + '(' + buildBlockedAccountSQL(blockerAccountIds) + ')' + ) + } + }, + { + accountId: null + } + ] } ] } -- cgit v1.2.3