From 3bdbc40519692abcd646461519e0df5de8bba5bd Mon Sep 17 00:00:00 2001 From: miko <34790748+keikari@users.noreply.github.com> Date: Sat, 11 May 2024 19:13:34 +0300 Subject: [PATCH] Exclude blocked comments from "total_items" count --- server/services/v1/comments/list.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/services/v1/comments/list.go b/server/services/v1/comments/list.go index c50c1e0..172df51 100644 --- a/server/services/v1/comments/list.go +++ b/server/services/v1/comments/list.go @@ -66,7 +66,7 @@ func list(_ *http.Request, args *commentapi.ListArgs, reply *commentapi.ListResp filterFlaggedComments := m.CommentWhere.IsFlagged.EQ(false) totalFilteredCommentsQuery := make([]qm.QueryMod, 0) - totalCommentsQuery := make([]qm.QueryMod, 0) + totalCommentsQuery := []qm.QueryMod{loadChannels} offset := (args.Page - 1) * args.PageSize getCommentsQuery := applySorting(args.SortBy, []qm.QueryMod{loadChannels, qm.Offset(offset), qm.Limit(args.PageSize)}) hasHiddenCommentsQuery := []qm.QueryMod{filterIsHidden, qm.Limit(1)}