콘솔삭제

This commit is contained in:
kimdaae328 2025-02-27 13:59:20 +09:00
parent 4145fdc445
commit 00f632e607

View File

@ -263,7 +263,8 @@ const handleUpdateReaction = async ({ boardId, commentId, isLike, isDislike }) =
// console.log(" :", updatedData);
} catch (error) {
alert('반응을 업데이트하는 중 오류 발생');
alert('오류가 발생했습니다.');
// console.log(' .');
}
};
@ -285,7 +286,8 @@ const handleCommentReaction = async ({ boardId, commentId, isLike, isDislike })
await fetchComments();
} catch (error) {
alert('댓글 반응을 업데이트하는 중 오류 발생');
alert('오류가 발생했습니다.');
// console.log(' ');
}
};
@ -370,7 +372,8 @@ const fetchComments = async (page = 1) => {
} catch (error) {
console.log('댓글 목록 불러오기 오류:', error);
alert('오류가 발생했습니다.');
// alert(' :', error);
}
};
@ -410,10 +413,12 @@ const handleCommentSubmit = async (data, isCheck) => {
commentAlert.value = '';
await fetchComments();
} else {
console.error('댓글 작성 실패:', response.data.message);
// console.error(' :', response.data.message);
alert("댓글 작성을 실패했습니다.")
}
} catch (error) {
console.error('댓글 작성 중 오류 발생:', error);
// console.error(' :', error);
alert("오류가 발생했습니다.")
}
};
@ -430,19 +435,21 @@ const handleCommentReply = async (reply) => {
if (response.status === 200) {
if (response.data.code === 200) { //
console.log('대댓글 작성 성공:', response.data);
// console.log(' :', response.data);
await fetchComments(); //
} else {
console.log('대댓글 작성 실패 - 서버 응답:', response.data);
alert('대댓글 작성 실패했습니다.');
// console.log(' - :', response.data);
alert('대댓글 작성 실패했습니다.');
}
}
} catch (error) {
console.error('대댓글 작성 중 오류 발생:', error);
// console.error(' :', error);
if (error.response) {
console.error('서버 응답 에러:', error.response.data);
// console.error(' :', error.response.data);
alert("오류가 발생했습니다.");
}
alert('대댓글 작성 중 오류가 발생했습니다.');
alert("오류가 발생했습니다.");
}
}
@ -501,7 +508,8 @@ const editComment = (comment) => {
toggleCommentPassword(comment, "edit");
} else {
console.log("⛔ 다른 사용자 댓글 - 수정 불가");
// console.log(" - ");
alert("수정이 불가능합니다");
}
}
@ -593,8 +601,8 @@ const submitPassword = async () => {
// ( )
const submitCommentPassword = async (comment, password) => {
console.log("비밀번호 :", password);
console.log("댓글 ID:", comment.commentId);
// console.log(" :", password);
// console.log(" ID:", comment.commentId);
if (!password) {
passwordCommentAlert.value = "비밀번호를 입력해주세요.";
@ -602,12 +610,12 @@ const submitCommentPassword = async (comment, password) => {
}
try {
console.log('서버로 비밀번호 확인 요청')
// console.log(' ')
const response = await axios.post(`board/comment/${comment.commentId}/password`, {
LOCCMTPWD: password,
LOCCMTSEQ: comment.commentId,
});
console.log("✅ 서버 응답 데이터:", response.data);
// console.log(" :", response.data);
if (response.data.code === 200 && response.data.data === true) {
passwordCommentAlert.value = "";
@ -625,14 +633,14 @@ const submitCommentPassword = async (comment, password) => {
}
lastCommentClickedButton.value = null;
} else {
console.log("❌ 비밀번호가 틀림");
// console.log(" ");
passwordCommentAlert.value = "비밀번호가 일치하지 않습니다.";
}
} catch (error) {
console.log("🚨 서버 요청 중 오류 발생:", error.response?.data || error);
if (error.response?.status === 401) {
console.log("❌ 401 오류: 인증 실패 (비밀번호 불일치)");
}
// console.log("🚨 :", error.response?.data || error);
// if (error.response?.status === 401) {
// console.log(" 401 : ( )");
// }
passwordCommentAlert.value = "비밀번호가 일치하지 않습니다";
}
};
@ -681,7 +689,7 @@ const deleteReplyComment = async (comment) => {
alert("댓글 삭제에 실패했습니다.");
}
} catch (error) {
console.log("댓글 삭제 중 오류 발생:", error);
// console.log(" :", error);
alert("댓글 삭제 중 오류가 발생했습니다.");
}
};
@ -704,13 +712,16 @@ const handleSubmitEdit = async (comment, editedContent) => {
targetComment.content = editedContent; //
targetComment.isEditTextarea = false; //
} else {
console.warn("❌ 수정할 댓글을 찾을 수 없음");
// console.warn(" ");
alert("수정할 댓글을 찾을 수 없습니다.");
}
} else {
console.log("❌ 댓글 수정 실패:", response.data);
// console.log(" :", response.data);
alert("댓글 수정 실패했습니다.");
}
} catch (error) {
console.error("댓글 수정 중 오류 발생:", error);
// console.error(" :", error);
alert("댓글 수정 중 오류 발생했습니다.");
}
};
@ -719,10 +730,11 @@ const handleCancelEdit = (comment) => {
const targetComment = findCommentById(comment.commentId, comments.value);
if (targetComment) {
console.log("✅ 원본 데이터 찾음, 수정 취소 처리 가능:", targetComment);
// console.log(" , :", targetComment);
targetComment.isEditTextarea = false;
} else {
console.error("❌ 원본 데이터 찾을 수 없음, 수정 취소 실패");
// console.error(" , ");
alert("수정 취소를 실패했습니다.");
}
};
@ -753,7 +765,7 @@ const handleCommentDeleted = (deletedCommentId) => {
}
}
console.error("❌ 삭제할 댓글을 찾을 수 없음:", deletedCommentId);
// console.error(" :", deletedCommentId);
};