diff options
author | Chocobozzz <me@florianbigard.com> | 2020-01-03 11:53:51 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-01-03 11:53:51 +0100 |
commit | 562724a1ed13fe93aba08ca1a0f8e029819e9f32 (patch) | |
tree | d3cdd688f6dbd07f9e83022de883711f073e5cb7 /server/models | |
parent | 0385b797504f05d1c103fad96d013a8ea355539b (diff) | |
download | PeerTube-562724a1ed13fe93aba08ca1a0f8e029819e9f32.tar.gz PeerTube-562724a1ed13fe93aba08ca1a0f8e029819e9f32.tar.zst PeerTube-562724a1ed13fe93aba08ca1a0f8e029819e9f32.zip |
Fix totalRepliesFromVideoAuthor SQL request
Diffstat (limited to 'server/models')
-rw-r--r-- | server/models/video/video-comment.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/server/models/video/video-comment.ts b/server/models/video/video-comment.ts index c2798e82a..fb4d16b4d 100644 --- a/server/models/video/video-comment.ts +++ b/server/models/video/video-comment.ts | |||
@@ -62,8 +62,10 @@ enum ScopeNames { | |||
62 | '(' + | 62 | '(' + |
63 | 'SELECT COUNT("replies"."id") ' + | 63 | 'SELECT COUNT("replies"."id") ' + |
64 | 'FROM "videoComment" AS "replies" ' + | 64 | 'FROM "videoComment" AS "replies" ' + |
65 | 'INNER JOIN "video" ON "video"."id" = "replies"."videoId" ' + | ||
66 | 'INNER JOIN "videoChannel" ON "videoChannel"."id" = "video"."channelId" ' + | ||
65 | 'WHERE "replies"."originCommentId" = "VideoCommentModel"."id" ' + | 67 | 'WHERE "replies"."originCommentId" = "VideoCommentModel"."id" ' + |
66 | 'AND "accountId" = ' + userAccountId + | 68 | 'AND "replies"."accountId" = "videoChannel"."accountId"' + |
67 | ')' | 69 | ')' |
68 | ), | 70 | ), |
69 | 'totalRepliesFromVideoAuthor' | 71 | 'totalRepliesFromVideoAuthor' |