Re-implement public search
This commit is contained in:
parent
ba092152f2
commit
16b4a5ae07
2 changed files with 4 additions and 4 deletions
|
@ -257,7 +257,8 @@ export const searchPosts = async (
|
|||
title: {
|
||||
contains: query
|
||||
},
|
||||
authorId: userId
|
||||
authorId: userId,
|
||||
visibility: userId ? undefined : "public"
|
||||
},
|
||||
{
|
||||
files: {
|
||||
|
@ -267,6 +268,7 @@ export const searchPosts = async (
|
|||
}
|
||||
}
|
||||
},
|
||||
visibility: userId ? undefined : "public",
|
||||
authorId: userId
|
||||
}
|
||||
]
|
||||
|
|
|
@ -26,9 +26,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
|||
}
|
||||
|
||||
const posts = await searchPosts(searchQuery, {
|
||||
userId,
|
||||
withFiles: true,
|
||||
publicOnly: false
|
||||
userId
|
||||
})
|
||||
|
||||
return res.json(posts)
|
||||
|
|
Loading…
Reference in a new issue