From 63ae8b39bbb25dcd9ead77e21123039ebe74223a Mon Sep 17 00:00:00 2001 From: TaeeunKim Date: Mon, 16 Oct 2023 14:39:28 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20totalElements=EA=B0=80=20=EC=97=86?= =?UTF-8?q?=EB=8A=94=20=EA=B2=BD=EC=9A=B0=20query=20string=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EC=A0=9C=EC=99=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hooks/queries/recipe/useInfiniteRecipeCommentQuery.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/hooks/queries/recipe/useInfiniteRecipeCommentQuery.ts b/frontend/src/hooks/queries/recipe/useInfiniteRecipeCommentQuery.ts index 7bcbe60f5..c5514f3f1 100644 --- a/frontend/src/hooks/queries/recipe/useInfiniteRecipeCommentQuery.ts +++ b/frontend/src/hooks/queries/recipe/useInfiniteRecipeCommentQuery.ts @@ -10,10 +10,11 @@ interface PageParam { const fetchRecipeComments = async (pageParam: PageParam, recipeId: number) => { const { lastId, totalElements } = pageParam; + const queries = `?lastId=${lastId}${totalElements !== null ? `&totalElements=${totalElements}` : ''}`; + const response = await recipeApi.get({ params: `/${recipeId}/comments`, - queries: `?lastId=${lastId}&totalElements=${totalElements}`, - credentials: true, + queries: queries, }); const data: CommentResponse = await response.json(); return data;