diff --git a/src/components/Latest.js b/src/components/Latest.js index 0cb4dce..ae93789 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 7ed9647..030ed26 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 0060804..d9162fe 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); }