Skip to content

Commit

Permalink
[fix] #3 메인페이지 > API 데이터 파싱 수정
Browse files Browse the repository at this point in the history
API JSON 형태 변경에 따라 파싱 키워드 및 단계 수정
  • Loading branch information
Junanjunan committed Jul 11, 2024
1 parent 05ed3a1 commit ccc9d4c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/components/Latest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/LatestGallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/LatestGallerySlide.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit ccc9d4c

Please sign in to comment.