프로필부분 좋아요 수정
This commit is contained in:
parent
c68043f12b
commit
922fc09c2d
@ -8,8 +8,11 @@
|
|||||||
<BoardProfile
|
<BoardProfile
|
||||||
:boardId="currentBoardId"
|
:boardId="currentBoardId"
|
||||||
:profileName="profileName"
|
:profileName="profileName"
|
||||||
|
:views="views"
|
||||||
|
:likes="likes"
|
||||||
|
:dislikes="dislikes"
|
||||||
class="pb-6 border-bottom"
|
class="pb-6 border-bottom"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<!-- 게시글 내용 -->
|
<!-- 게시글 내용 -->
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
@ -73,6 +76,9 @@ const boardTitle = ref('제목 없음');
|
|||||||
const boardContent = ref('');
|
const boardContent = ref('');
|
||||||
const comments = ref([]);
|
const comments = ref([]);
|
||||||
const attachments = ref([]);
|
const attachments = ref([]);
|
||||||
|
const views = ref(0);
|
||||||
|
const likes = ref(0);
|
||||||
|
const dislikes = ref(0);
|
||||||
|
|
||||||
// 라우트에서 ID 가져오기
|
// 라우트에서 ID 가져오기
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
@ -88,13 +94,20 @@ const goToEditPage = () => {
|
|||||||
const fetchBoardDetails = async () => {
|
const fetchBoardDetails = async () => {
|
||||||
try {
|
try {
|
||||||
const response = await axios.get(`board/${currentBoardId.value}`);
|
const response = await axios.get(`board/${currentBoardId.value}`);
|
||||||
|
console.log('전체 응답 데이터:', response.data);
|
||||||
const data = response.data.data;
|
const data = response.data.data;
|
||||||
|
console.log('data 내부 데이터:', data);
|
||||||
|
|
||||||
// API 응답 데이터 반영
|
// API 응답 데이터 반영
|
||||||
const boardDetail = data.boardDetail || {};
|
const boardDetail = data.boardDetail || {};
|
||||||
profileName.value = boardDetail.author || '익명 사용자';
|
// console.log('boardDetail:', boardDetail);
|
||||||
boardTitle.value = boardDetail.title || '제목 없음';
|
|
||||||
boardContent.value = boardDetail.content || '';
|
profileName.value = data.author || '익명 사용자';
|
||||||
|
boardTitle.value = data.title || '제목 없음';
|
||||||
|
boardContent.value = data.content || '';
|
||||||
|
views.value = data.cnt || 0;
|
||||||
|
likes.value = data.likeCount || 0;
|
||||||
|
dislikes.value = data.dislikeCount || 0;
|
||||||
|
|
||||||
attachments.value = data.attachments || [];
|
attachments.value = data.attachments || [];
|
||||||
comments.value = data.comments || [];
|
comments.value = data.comments || [];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user