This commit is contained in:
kimdaae328 2025-02-21 12:58:11 +09:00
parent c88b01f78f
commit cd01f0767e
2 changed files with 28 additions and 28 deletions

View File

@ -56,7 +56,7 @@
:comment="child"
:unknown="unknown"
:isPlusButton="false"
:isLike="true"
:isLike="true"
@submitComment="submitComment"
@updateReaction="handleUpdateReaction"
/>

View File

@ -262,7 +262,7 @@ const handleCommentReaction = async ({ boardId, commentId, isLike, isDislike })
}
};
//
// ( )
const fetchComments = async (page = 1) => {
try {
//
@ -297,7 +297,7 @@ const fetchComments = async (page = 1) => {
params: { LOCCMTPNT: comment.commentId }
});
// console.log(`📌 (${comment.commentId} ):`, replyResponse.data);
// console.log(` (${comment.commentId} ):`, replyResponse.data);
if (replyResponse.data.data) {
comment.children = replyResponse.data.data.map(reply => ({
@ -379,15 +379,15 @@ const handleCommentSubmit = async ({ comment, password }) => {
};
//
// ( `BoardCommentList` )
const handleCommentReply = async (reply) => {
try {
console.log('대댓글 작성 요청 데이터:', {
LOCBRDSEQ: currentBoardId.value,
LOCCMTRPY: reply.comment,
LOCCMTPWD: reply.password || null,
LOCCMTPNT: reply.parentId
});
// console.log(' :', {
// LOCBRDSEQ: currentBoardId.value,
// LOCCMTRPY: reply.comment,
// LOCCMTPWD: reply.password || null,
// LOCCMTPNT: reply.parentId
// });
const response = await axios.post(`board/${currentBoardId.value}/comment`, {
LOCBRDSEQ: currentBoardId.value,
@ -397,11 +397,11 @@ const handleCommentReply = async (reply) => {
});
//
console.log('대댓글 작성 응답:', {
status: response.status,
data: response.data,
headers: response.headers
});
// console.log(' :', {
// status: response.status,
// data: response.data,
// headers: response.headers
// });
if (response.status === 200) {
if (response.data.code === 200) { //
@ -439,14 +439,14 @@ const deleteClick = (unknown) => {
}
};
//
// ( )
const editComment = (comment) => {
if (comment.isEditTextarea) {
//
comment.isEditTextarea = false;
return;
}
if (unknown.value) {
toggleCommentPassword(comment, "edit");
} else {
@ -465,7 +465,7 @@ const editComment = (comment) => {
// }
}
//
// ( )
const deleteComment = (comment) => {
if (unknown.value) {
if (comment.isEditTextarea) {
@ -550,7 +550,7 @@ const submitPassword = async () => {
}
};
//
// ( )
const submitCommentPassword = async (comment, password) => {
if (!password) {
passwordCommentAlert.value = "비밀번호를 입력해주세요.";
@ -578,7 +578,7 @@ const submitCommentPassword = async (comment, password) => {
passwordCommentAlert.value = "비밀번호가 일치하지 않습니다.";
}
} catch (error) {
passwordCommentAlert.value = "비밀번호 검증 중 오류가 발생했습니다.";
passwordCommentAlert.value = "비밀번호가 일치하지 않습니다";
}
};
@ -606,7 +606,7 @@ const deletePost = async () => {
}
};
//
// ( )
const deleteReplyComment = async (comment) => {
if (!confirm("정말 이 댓글을 삭제하시겠습니까?")) return;
// console.log(" ID:", comment);
@ -631,13 +631,7 @@ const deleteReplyComment = async (comment) => {
}
};
//
const handleCancelEdit = (comment) => {
console.log("BoardView.vue - 댓글 수정 취소:", comment);
comment.isEditTextarea = false;
};
//
// ( )
const handleSubmitEdit = async (comment, editedContent) => {
try {
const response = await axios.put(`board/comment/${comment.commentId}`, {
@ -653,6 +647,12 @@ const handleSubmitEdit = async (comment, editedContent) => {
}
};
// ( )
const handleCancelEdit = (comment) => {
console.log("BoardView.vue - 댓글 수정 취소:", comment);
comment.isEditTextarea = false;
};
//
const handlePageChange = (page) => {
if (page !== pagination.value.currentPage) {