fix: filter search content by posts that are not children
This commit is contained in:
1 parent
f63da9792d
commit
2162f87cfb
1 file changed
+3
-1
+3
-1
@@ -278,7 +278,9 @@ export const getPostsBySearchTerm = query({
|
|||||||
handler: async (ctx, args) => {
|
handler: async (ctx, args) => {
|
||||||
return await ctx.db
|
return await ctx.db
|
||||||
.query('posts')
|
.query('posts')
|
||||||
.withSearchIndex('search_by_content', q => q.search('content', args.term))
|
.withSearchIndex('search_by_content', q =>
|
||||||
|
q.search('content', args.term).eq('parentPostId', undefined)
|
||||||
|
)
|
||||||
.paginate(args.paginationOpts);
|
.paginate(args.paginationOpts);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
Reference in new issue
Block a user