api보드리스트 수정정
This commit is contained in:
parent
d87a87450a
commit
68d1b41f11
@ -49,18 +49,17 @@ const filteredList = computed(() =>
|
||||
|
||||
// 게시물 데이터 로드
|
||||
const fetchPosts = async () => {
|
||||
try {
|
||||
const response = await axios.get("board/general");
|
||||
if (response.data && Array.isArray(response.data.data)) {
|
||||
list.value = response.data.data.map((post) => ({
|
||||
...post,
|
||||
img: post.img || null,
|
||||
likes: post.likes || 0,
|
||||
comments: post.comments || 0,
|
||||
}));
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Failed to fetch posts:", error);
|
||||
const response = await axios.get("board/general");
|
||||
console.log(response.data.data.list)
|
||||
if (response.data && response.data.data && Array.isArray(response.data.data.list)) {
|
||||
list.value = response.data.data.list.map((post) => ({
|
||||
...post,
|
||||
img: post.img || null,
|
||||
likes: post.likes || 0,
|
||||
comments: post.comments || 0,
|
||||
}));
|
||||
} else {
|
||||
console.error("Unexpected API response structure:", response.data);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user