From 08aeb2ff2b5f9d907e4e82af0ea106ff18298499 Mon Sep 17 00:00:00 2001 From: Taeeun Kim Date: Thu, 19 Oct 2023 14:38:56 +0900 Subject: [PATCH] =?UTF-8?q?[FE]=20fix:=20totalElements=EC=99=80=20comments?= =?UTF-8?q?=20=EB=B3=80=EC=88=98=EB=A5=BC=20destructing=20=ED=95=98?= =?UTF-8?q?=EB=8A=94=20=EB=B0=A9=EB=B2=95=20=EC=88=98=EC=A0=95=20(#801)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/Recipe/CommentList/CommentList.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/Recipe/CommentList/CommentList.tsx b/frontend/src/components/Recipe/CommentList/CommentList.tsx index 0330c705..d44f33c3 100644 --- a/frontend/src/components/Recipe/CommentList/CommentList.tsx +++ b/frontend/src/components/Recipe/CommentList/CommentList.tsx @@ -16,7 +16,8 @@ const CommentList = ({ recipeId }: CommentListProps) => { const { fetchNextPage, hasNextPage, data } = useInfiniteRecipeCommentQuery(Number(recipeId)); useIntersectionObserver(fetchNextPage, scrollRef, hasNextPage); - const [{ totalElements, comments }] = data.pages.flatMap((page) => page); + const [{ totalElements }] = data.pages.flatMap((page) => page); + const comments = data.pages.flatMap((page) => page.comments); return ( <>