From b8661afae12531864b4b6cec5507efe018dd663b Mon Sep 17 00:00:00 2001 From: Tom Sherman Date: Wed, 3 Jul 2024 10:45:17 +0100 Subject: [PATCH] Hide non-life comments Closes UN-96 --- packages/frontpage/lib/data/db/comment.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/frontpage/lib/data/db/comment.ts b/packages/frontpage/lib/data/db/comment.ts index 4218258f..954cf225 100644 --- a/packages/frontpage/lib/data/db/comment.ts +++ b/packages/frontpage/lib/data/db/comment.ts @@ -159,7 +159,12 @@ export const getUserComments = cache(async (userDid: DID) => { }) .from(schema.Comment) .leftJoin(schema.Post, eq(schema.Comment.postId, schema.Post.id)) - .where(eq(schema.Comment.authorDid, userDid)); + .where( + and( + eq(schema.Comment.authorDid, userDid), + eq(schema.Comment.status, "live"), + ), + ); return posts; });