From dc4d2227743d312af02e258bb233aa682875cf00 Mon Sep 17 00:00:00 2001 From: Elifnurdeniz Date: Mon, 16 Dec 2024 15:36:04 +0300 Subject: [PATCH] fix(frontend): made forum recursive AGAIN --- frontend/src/pages/post.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/pages/post.tsx b/frontend/src/pages/post.tsx index 975f9590..136bb843 100644 --- a/frontend/src/pages/post.tsx +++ b/frontend/src/pages/post.tsx @@ -50,7 +50,9 @@ export default function Post() { console.log(response.data); const postData: PostResponse = response.data.post; setPost(convertPostResponseToPost(postData)); - setComments(convertPostResponseToPost(postData).comments); + setComments( + convertPostResponseToPost(postData).comments.filter((comment) => comment.parent === Number(postID)) + ); }) .catch((error) => { console.log(error);