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

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