Skip to content

Commit

Permalink
Merge pull request #33 from Triumers/feat/post
Browse files Browse the repository at this point in the history
[Refactor] 익명게시판 라우터 수정 및 경로 수정
  • Loading branch information
Leegiyeon authored Jun 5, 2024
2 parents 135da75 + 1a68e96 commit b37d426
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/components/anonymous-board/AnonymousBoardDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ async function saveAnonymousBoardComment() {
async function deleteAnonymousBoard() {
try {
await axios.delete(`http://localhost:5000/anonymous-board/${route.params.id}`);
router.push('/office-life/anonymous-board');
router.push('/office-life/anonymous-board/list');
} catch (error) {
console.error('Failed to delete anonymous board:', error);
}
Expand Down Expand Up @@ -142,7 +142,7 @@ function nextPage() {
}
function goToBoardList() {
router.push('/office-life/3/anonymous-board/list');
router.push('/office-life/anonymous-board/list');
}
function checkAdminRole() {
Expand Down
4 changes: 2 additions & 2 deletions src/components/anonymous-board/AnonymousBoardList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ async function searchAnonymousBoards() {
}
function goToWriteForm() {
router.push('/office-life/3/anonymous-board/new');
router.push('/office-life/anonymous-board/new');
}
function goToBoardDetail(boardId) {
router.push(`/office-life/3/anonymous-board/${boardId}`);
router.push(`/office-life/anonymous-board/${boardId}`);
}
function formatNickname(nickname) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/anonymous-board/CreateNewAnonymousBoard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ async function saveAnonymousBoard() {
content: content.value,
nickname: nickname.value,
});
router.push(`/office-life/3/anonymous-board/${response.data.id}`); // 상세 페이지 URL 수정
router.push(`/office-life/anonymous-board/${response.data.id}`); // 상세 페이지 URL 수정
} catch (error) {
console.error('Failed to save anonymous board:', error);
// 에러 처리 로직 추가
Expand Down
16 changes: 14 additions & 2 deletions src/components/common/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,20 @@
</li>
</ul>
</li>
<li class="nav-item">
<router-link class="nav-link" to="/office-life/3">Office Life</router-link>

<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown"
aria-expanded="false">
Office Life
</a>
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
<li>
<router-link class="dropdown-item" to="/office-life/3">회사생활</router-link>
</li>
<li>
<router-link class="dropdown-item" to="/office-life/anonymous-board/list">익명게시판</router-link>
</li>
</ul>
</li>
</div>
</template>
Expand Down

0 comments on commit b37d426

Please sign in to comment.