Fix thread replies API response

pull/3759/head
Chocobozzz 2021-02-19 10:52:31 +01:00
parent 285981f4dd
commit 2a021e6cb6
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 17 additions and 13 deletions

View File

@ -166,8 +166,6 @@ async function listVideoThreadComments (req: express.Request, res: express.Respo
}
}
logger.info('coucou', { resultList })
if (resultList.data.length === 0) {
return res.sendStatus(HttpStatusCode.NOT_FOUND_404)
}

View File

@ -483,10 +483,14 @@ export class VideoCommentModel extends Model {
order: [ [ 'createdAt', 'ASC' ], [ 'updatedAt', 'ASC' ] ] as Order,
where: {
videoId,
[Op.and]: [
{
[Op.or]: [
{ id: threadId },
{ originCommentId: threadId }
],
]
},
{
[Op.or]: [
{
accountId: {
@ -500,6 +504,8 @@ export class VideoCommentModel extends Model {
}
]
}
]
}
}
const scopes: any[] = [