diff --git a/src/app/p/[secret]/posts/page.tsx b/src/app/p/[secret]/posts/page.tsx index 5890481..0f58704 100644 --- a/src/app/p/[secret]/posts/page.tsx +++ b/src/app/p/[secret]/posts/page.tsx @@ -118,7 +118,7 @@ export default function AdminPostsPage() { ))} setSearch(e.target.value)} className="w-64 bg-zinc-900 border-zinc-700 text-zinc-100 placeholder:text-zinc-500" diff --git a/src/trpc/routers/admin.ts b/src/trpc/routers/admin.ts index 1062c25..24584ee 100644 --- a/src/trpc/routers/admin.ts +++ b/src/trpc/routers/admin.ts @@ -161,7 +161,12 @@ export const adminRouter = router({ await assertAdmin(ctx.prisma, ctx.userId); const posts = await ctx.prisma.post.findMany({ where: input.search - ? { caption: { contains: input.search, mode: "insensitive" } } + ? { + OR: [ + { caption: { contains: input.search, mode: "insensitive" } }, + { pet: { name: { contains: input.search, mode: "insensitive" } } }, + ], + } : undefined, include: { pet: { select: { id: true, name: true, avatarKey: true, ownerId: true } },