From ac47e04462e259f2dbf7394174003a1814288764 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=A4=80=ED=9D=AC?= Date: Sun, 25 Feb 2024 01:15:42 +0900 Subject: [PATCH] =?UTF-8?q?FEAT=20:=20=EB=AC=B4=ED=95=9C=20=EC=8A=A4?= =?UTF-8?q?=ED=81=AC=EB=A1=A4=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MainPage/List.tsx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/MainPage/List.tsx b/src/MainPage/List.tsx index 538f119c..632a8490 100644 --- a/src/MainPage/List.tsx +++ b/src/MainPage/List.tsx @@ -218,12 +218,7 @@ const Post = () => { try { const response = await axios.get(`/article?pageNumber=${pageNumber}`); const newData = response.data.article; - if (newData.length > 0) { - setArticleData((prevData) => [...prevData, ...newData]); // 기존 데이터와 새로운 데이터 결합 - setPageNumber((prevPageNumber) => prevPageNumber + 1); // 페이지 번호 증가 - } else { - // 데이터가 없는 경우, 더 이상 가져올 데이터가 없음을 나타낼 수 있는 처리를 추가 - } + setArticleData((prevData) => [...prevData, ...newData]); // 기존 데이터와 새로운 데이터 결합 } catch (error) { console.error('Error fetching user data:', error); }