Re-implement public search

This commit is contained in:
Max Leiter 2023-01-13 00:17:50 -08:00
parent ba092152f2
commit 16b4a5ae07
2 changed files with 4 additions and 4 deletions

View file

@ -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
}
]

View file

@ -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)