Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] 마이페이지 내가 좋아요/북마크 한 포스트 #39

Merged
merged 3 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/post/SelectedDocsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</select>
</span>

<b-form-input type="text" id="search-input" placeholder="검색어를 입력하세요" v-model="search.keyword"></b-form-input>
<b-form-input type="text" id="search-input" placeholder="검색어를 입력하세요" v-model="search.keyword" @keyup.enter="searchPost"></b-form-input>

<button class="search-button" id="search-post" @click="searchPost">
<img src="@/assets/icons/search_icon.png" alt="Search" />
Expand Down
4 changes: 2 additions & 2 deletions src/components/post/SelectedPostList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
</select>
</span>
<b-form-tags v-if="search.type == 'tag'" class="form-select pt-1" input-id="tags-separators"
v-model="search.tags" separator=" " placeholder="태그 입력 후, 스페이스 바를 눌러주세요." no-add-on-enter></b-form-tags>
<b-form-input v-else type="text" id="search-input" placeholder="검색어를 입력하세요"
v-model="search.tags" separator=" " placeholder="태그 입력 후, 스페이스 바를 눌러주세요." no-add-on-enter @keyup.enter="searchPost"></b-form-tags>
<b-form-input @keyup.enter="searchPost" v-else type="text" id="search-input" placeholder="검색어를 입력하세요"
v-model="search.keyword"></b-form-input>
<button class="search-button" id="search-post" @click="searchPost">
<img src="@/assets/icons/search_icon.png" alt="Search" />
Expand Down
2 changes: 1 addition & 1 deletion src/components/user/FavoritePosts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<p class="total-count">전체 {{ totalCount }}개</p>
</div>
<div class="post-list" ref="postList">
<div v-for="post in favoritePosts" :key="post.id" class="post-item" @click="goToPostDetail(post.id)">
<div v-for="post in favoritePosts" :key="post.id" class="post-item" @click="goToPostDetail((post.originId != 'null' ? post.originId : post.id))">
<div class="post-title">{{ post.title }}</div>
</div>
</div>
Expand Down
4 changes: 3 additions & 1 deletion src/components/user/LikedPosts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<p class="total-count">전체 {{ totalCount }}개</p>
</div>
<div class="post-list" ref="postList">
<div v-for="post in likedPosts" :key="post.id" class="post-item" @click="goToPostDetail(post.id)">
<div v-for="post in likedPosts" :key="post.id" class="post-item" @click="goToPostDetail((post.originId != 'null' ? post.originId : post.id))">
<div class="post-title">{{ post.title }}</div>
</div>
</div>
Expand Down Expand Up @@ -49,6 +49,7 @@
},
});

console.log(response.data);
likedPosts.value = [...likedPosts.value, ...response.data.docsInfoList];
currentPage.value++;
} catch (error) {
Expand All @@ -67,6 +68,7 @@
}

function goToPostDetail(postId) {
console.log(postId);
router.push(`/wiki/detail/${postId}`);
}
</script>
Expand Down
2 changes: 1 addition & 1 deletion src/views/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</span>
<b-form-tags v-if="search.type == 'tag'" class="form-select pt-1 search-input" input-id="tags-separators"
v-model="search.tags" separator=" " placeholder="태그 입력 후, 스페이스 바를 눌러주세요." no-add-on-enter></b-form-tags>
<input v-else type="text" v-model="search.keyword" placeholder="검색어를 입력하세요" class="search-input" />
<input v-else type="text" v-model="search.keyword" placeholder="검색어를 입력하세요" class="search-input" @keyup.enter="searchPost" />
<button class="search-button" @click="searchPost">
<img src="@/assets/icons/search_icon.png" alt="Search" />
</button>
Expand Down
13 changes: 12 additions & 1 deletion src/views/Study.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<template>
<div>
<div id="top">
<span class="search-type">
<span class="search-type" v-if="studyTab && studyTab.length > 0">
<select v-model="selectedTab" class="form-select pt-1 search-type"
style="width:fit-content; vertical-align: middle; margin-right: 10px;" @change="changeStudy">
<option v-for="tab in studyTab" :value="tab.tabId">
{{ tab.bottomTabName }}
</option>
</select>
</span>
<span v-else class="no-study-message">스터디가 존재하지 않습니다.</span>
</div>
<div>
<RouterView :key="$route.fullPath" />
Expand Down Expand Up @@ -54,6 +55,7 @@ async function getUserCategory() {

function setCategory() {
studyTab.value = categoryList.value.filter(category => category.topTabName === "스터디").map(category => category);
console.log(studyTab.value);
selectedTab.value = studyTab.value[0].tabId;
}
</script>
Expand All @@ -64,4 +66,13 @@ function setCategory() {
justify-content: space-between;
margin-bottom: 10px;
}

.no-study-message {
width: 100%;
display: flex;
justify-content: center;
align-items: center;
vertical-align: middle;
margin-top: 20px;
}
</style>
Loading