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); }