From a2e9314724b5d92e66fd32e6fca4a1b63562bfc1 Mon Sep 17 00:00:00 2001 From: Joonas Date: Sat, 14 Jan 2023 13:23:40 +0200 Subject: [PATCH] added relation between post replyid and id so we can show and link replies on the reply in the thread --- app/routes/threads/$threadId.jsx | 35 +++++++++++++++++++++++--------- prisma/schema.prisma | 2 ++ 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/app/routes/threads/$threadId.jsx b/app/routes/threads/$threadId.jsx index 54ab30a..d4744fc 100644 --- a/app/routes/threads/$threadId.jsx +++ b/app/routes/threads/$threadId.jsx @@ -56,7 +56,11 @@ export async function loader({ params }) { id: parseInt(threadId), }, include: { - posts: true, + posts: { + include: { + replies: true, + }, + }, }, }); @@ -80,15 +84,26 @@ export default function Thread() {