Skip to content

Commit

Permalink
Merge pull request #68 from Triumers/feat/post
Browse files Browse the repository at this point in the history
[Refactor] 페이징 처리 수정/번역 post id 수정
  • Loading branch information
noctesilente authored Jun 13, 2024
2 parents ab26c5f + 225e435 commit 13f15b0
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 33 deletions.
2 changes: 1 addition & 1 deletion src/components/post/SelectedPostDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
8 changes: 0 additions & 8 deletions src/components/user/FavoritePosts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
onMounted(async () => {
await fetchFavoritePosts();
window.addEventListener('scroll', handleScroll);
});
async function fetchFavoritePosts() {
Expand Down Expand Up @@ -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}`);
}
Expand Down
8 changes: 0 additions & 8 deletions src/components/user/LikedPosts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
onMounted(async () => {
await fetchLikedPosts();
window.addEventListener('scroll', handleScroll);
});
async function fetchLikedPosts() {
Expand Down Expand Up @@ -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}`);
Expand Down
8 changes: 0 additions & 8 deletions src/components/user/MyComments.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
onMounted(async () => {
await fetchMyComments();
window.addEventListener('scroll', handleScroll);
});
async function fetchMyComments() {
Expand Down Expand Up @@ -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}`);
Expand Down
8 changes: 0 additions & 8 deletions src/components/user/MyPosts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
onMounted(async () => {
await fetchMyPosts();
window.addEventListener('scroll', handleScroll);
});
async function fetchMyPosts() {
Expand Down Expand Up @@ -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}`);
}
Expand Down

0 comments on commit 13f15b0

Please sign in to comment.