From 31dd29a9c22c8e0cec4e752659185982f23614c1 Mon Sep 17 00:00:00 2001 From: Stevan Freeborn <65925598+StevanFreeborn@users.noreply.github.com> Date: Fri, 15 Sep 2023 17:05:32 -0500 Subject: [PATCH] fix: only include parent posts in user post count --- convex/posts.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/convex/posts.ts b/convex/posts.ts index f4b45ac..2b04cb7 100644 --- a/convex/posts.ts +++ b/convex/posts.ts @@ -154,6 +154,7 @@ export const getUserPostCount = query({ const posts = await ctx.db .query('posts') .withIndex('by_user_id', q => q.eq('userId', args.userId)) + .filter(q => q.eq(q.field('parentPostId'), undefined)) .collect(); return posts.length;