fix: only include parent posts in user post count
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user