diff --git a/src/components/post/SelectedPostDetail.vue b/src/components/post/SelectedPostDetail.vue index b70a8aa..4ce461c 100644 --- a/src/components/post/SelectedPostDetail.vue +++ b/src/components/post/SelectedPostDetail.vue @@ -260,7 +260,7 @@ const handleTranslation = async () => { post.value = { ...originalPost.value }; } else { try { - const response = await axios.get(`/translate/${postId}/${selectedLanguage.value}`); + const response = await axios.get(`/translate/${post.value.id}/${selectedLanguage.value}`); post.value.title = response.data.title; post.value.content = response.data.content; } catch (error) { diff --git a/src/components/user/FavoritePosts.vue b/src/components/user/FavoritePosts.vue index 7f220c9..0da4f6b 100644 --- a/src/components/user/FavoritePosts.vue +++ b/src/components/user/FavoritePosts.vue @@ -29,7 +29,6 @@ onMounted(async () => { await fetchFavoritePosts(); - window.addEventListener('scroll', handleScroll); }); async function fetchFavoritePosts() { @@ -59,13 +58,6 @@ isLoading.value = false; } - function handleScroll() { - const { scrollTop, clientHeight, scrollHeight } = document.documentElement; - if (scrollTop + clientHeight >= scrollHeight - 100) { - fetchFavoritePosts(); - } - } - function goToPostDetail(postId) { router.push(`/wiki/detail/${postId}`); } diff --git a/src/components/user/LikedPosts.vue b/src/components/user/LikedPosts.vue index 0dfb50c..9eb020f 100644 --- a/src/components/user/LikedPosts.vue +++ b/src/components/user/LikedPosts.vue @@ -29,7 +29,6 @@ onMounted(async () => { await fetchLikedPosts(); - window.addEventListener('scroll', handleScroll); }); async function fetchLikedPosts() { @@ -60,13 +59,6 @@ isLoading.value = false; } - function handleScroll() { - const { scrollTop, clientHeight, scrollHeight } = document.documentElement; - if (scrollTop + clientHeight >= scrollHeight - 100) { - fetchLikedPosts(); - } - } - function goToPostDetail(postId) { console.log(postId); router.push(`/wiki/detail/${postId}`); diff --git a/src/components/user/MyComments.vue b/src/components/user/MyComments.vue index a6d739e..2b34db6 100644 --- a/src/components/user/MyComments.vue +++ b/src/components/user/MyComments.vue @@ -29,7 +29,6 @@ onMounted(async () => { await fetchMyComments(); - window.addEventListener('scroll', handleScroll); }); async function fetchMyComments() { @@ -59,13 +58,6 @@ isLoading.value = false; } - function handleScroll() { - const { scrollTop, clientHeight, scrollHeight } = document.documentElement; - if (scrollTop + clientHeight >= scrollHeight - 100) { - fetchMyComments(); - } - } - function goToPost(postId) { if (postId) { router.push(`/wiki/detail/${postId}`); diff --git a/src/components/user/MyPosts.vue b/src/components/user/MyPosts.vue index 37f042d..c5f7217 100644 --- a/src/components/user/MyPosts.vue +++ b/src/components/user/MyPosts.vue @@ -29,7 +29,6 @@ onMounted(async () => { await fetchMyPosts(); - window.addEventListener('scroll', handleScroll); }); async function fetchMyPosts() { @@ -59,13 +58,6 @@ isLoading.value = false; } - function handleScroll() { - const { scrollTop, clientHeight, scrollHeight } = document.documentElement; - if (scrollTop + clientHeight >= scrollHeight - 100) { - fetchMyPosts(); - } - } - function goToPostDetail(postId) { router.push(`/wiki/detail/${postId}`); }