From e382df85c3b04fca38a0fd823fea127771ee6f74 Mon Sep 17 00:00:00 2001 From: Junanjunan Date: Thu, 11 Jul 2024 12:41:38 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20#3=20=EB=A9=94=EC=9D=B8=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20>=20API=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20?= =?UTF-8?q?=ED=8C=8C=EC=8B=B1=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit API JSON 형태 변경에 따라 파싱 키워드 및 단계 수정 --- src/components/Latest.js | 4 ++-- src/components/LatestGallery.js | 4 ++-- src/components/LatestGallerySlide.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/Latest.js b/src/components/Latest.js index 76fbb01..98e678b 100644 --- a/src/components/Latest.js +++ b/src/components/Latest.js @@ -36,8 +36,8 @@ const Latest = ({ bo_table, view_type, rows }) => { }); const data = response.data; - if (data[bo_table] && Array.isArray(data[bo_table])) { - setBoardData(data[bo_table]); + if (Array.isArray(data)) { + setBoardData(data); } else { console.error('API response data is not in the expected format:', data); } diff --git a/src/components/LatestGallery.js b/src/components/LatestGallery.js index 16a16a5..83fc340 100644 --- a/src/components/LatestGallery.js +++ b/src/components/LatestGallery.js @@ -44,8 +44,8 @@ const LatestGallery = ({ bo_table, view_type, rows }) => { }); const data = response.data; - if (data[bo_table] && Array.isArray(data[bo_table])) { - setBoardData(data[bo_table]); + if (Array.isArray(data)) { + setBoardData(data); } else { console.error('API response data is not in the expected format:', data); } diff --git a/src/components/LatestGallerySlide.js b/src/components/LatestGallerySlide.js index f6b67ea..d49de37 100644 --- a/src/components/LatestGallerySlide.js +++ b/src/components/LatestGallerySlide.js @@ -64,8 +64,8 @@ const LatestGallery = ({ bo_table, view_type, rows }) => { }); const data = response.data; - if (data[bo_table] && Array.isArray(data[bo_table])) { - setBoardData(data[bo_table]); + if (Array.isArray(data)) { + setBoardData(data); } else { console.error('API response data is not in the expected format:', data); }