diff --git a/src/lib/server/prisma.ts b/src/lib/server/prisma.ts index 2d30cec0..c249b2b2 100644 --- a/src/lib/server/prisma.ts +++ b/src/lib/server/prisma.ts @@ -259,10 +259,9 @@ export const searchPosts = async ( OR: [ { title: { - search: query + contains: query }, - authorId: userId, - visibility: publicOnly ? "public" : undefined + authorId: userId }, { files: { @@ -272,13 +271,9 @@ export const searchPosts = async ( } } }, - authorId: userId, - visibility: publicOnly ? "public" : undefined + authorId: userId } ] - }, - include: { - files: withFiles } }) diff --git a/src/pages/api/post/search.ts b/src/pages/api/post/search.ts index 129c5c9b..e8354739 100644 --- a/src/pages/api/post/search.ts +++ b/src/pages/api/post/search.ts @@ -10,14 +10,6 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => { const publicSearch = parseQueryParam(query.public) const searchQuery = parseQueryParam(q) - console.log( - "searchQuery", - searchQuery, - "publicSearch", - publicSearch, - "userId", - query.userId - ) if (!searchQuery) { res.status(400).json({ error: "Invalid query" }) return