Fix Prisma 7 JSON proxy serialization in RSC props

Prisma 7 wraps Json fields in proxy objects that RSC cannot serialize.
Fix: select specific columns (exclude content) in module page,
and JSON.parse/stringify lesson content before passing to client.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-25 13:36:04 +05:00
parent 9731fcab48
commit d8be6d6d95
2 changed files with 5 additions and 2 deletions
@@ -15,7 +15,10 @@ export default async function ModulePage({ params }: Props) {
where: { id: moduleId },
include: {
course: { select: { title: true } },
lessons: { orderBy: { order: "asc" } },
lessons: {
orderBy: { order: "asc" },
select: { id: true, title: true, order: true, published: true, kinescopeId: true },
},
},
}),
prisma.module.findMany({