diff --git a/src/components/board/BoardComment.vue b/src/components/board/BoardComment.vue
index ded58dc..c264de7 100644
--- a/src/components/board/BoardComment.vue
+++ b/src/components/board/BoardComment.vue
@@ -11,12 +11,10 @@
:isLike="!isLike"
:isCommentPassword="isCommentPassword"
:isCommentProfile="true"
- @editClick="aaaa"
+ @editClick="handleEditClick"
@deleteClick="$emit('deleteClick', comment)"
@updateReaction="handleUpdateReaction"
- />
-
-
+ />
@@ -30,16 +28,11 @@
{{ passwordCommentAlert }}
-
-
-
-
@@ -58,10 +51,6 @@
:key="child.commentId"
class="mt-8 pt-6 ps-10 border-top"
>
-
-
-
-
child.isCommentPassword: {{ child.isCommentPassword }}
{
emit('submitEdit', props.comment, localEditedContent.value);
};
-const aaaa = () => {
+const handleEditClick = () => {
emit('editClick', props.comment);
}
diff --git a/src/components/board/BoardCommentArea.vue b/src/components/board/BoardCommentArea.vue
index e696680..c7cfe2c 100644
--- a/src/components/board/BoardCommentArea.vue
+++ b/src/components/board/BoardCommentArea.vue
@@ -88,7 +88,6 @@ const isCheck = ref(props.unknown);
const emit = defineEmits(['submitComment']);
const LOCBRDTYP = isCheck.value ? '300102' : null;
function handleCommentSubmit() {
- console.log(isCheck.value)
emit('submitComment', {
comment: comment.value,
password: isCheck.value ? password.value : '',
diff --git a/src/views/board/BoardView.vue b/src/views/board/BoardView.vue
index 6030f77..1911f32 100644
--- a/src/views/board/BoardView.vue
+++ b/src/views/board/BoardView.vue
@@ -372,7 +372,6 @@ const fetchComments = async (page = 1) => {
// console.log("📌 댓글 목록:", comments.value);
-
} catch (error) {
alert('오류가 발생했습니다.');
// alert('댓글 목록 불러오기 오류:', error);
@@ -410,21 +409,18 @@ const handleCommentSubmit = async (data) => {
});
if (response.status === 200) {
- // console.log('댓글 작성 성공:', response.data.message);
passwordAlert.value = '';
commentAlert.value = '';
await fetchComments();
} else {
- // console.error('댓글 작성 실패:', response.data.message);
alert("댓글 작성을 실패했습니다.")
}
} catch (error) {
- // console.error('댓글 작성 중 오류 발생:', error);
alert("오류가 발생했습니다.")
}
};
-// 대댓글 추가 (부모 `BoardCommentList`로부터 이벤트 받아서 처리)
+// 대댓글 추가
const handleCommentReply = async (reply) => {
try {
const response = await axios.post(`board/${currentBoardId.value}/comment`, {
@@ -437,17 +433,13 @@ const handleCommentReply = async (reply) => {
if (response.status === 200) {
if (response.data.code === 200) { // 서버 응답 코드도 확인
- // console.log('대댓글 작성 성공:', response.data);
await fetchComments(); // 댓글 목록 새로고침
} else {
- // console.log('대댓글 작성 실패 - 서버 응답:', response.data);
alert('대댓글 작성을 실패했습니다.');
}
}
} catch (error) {
- // console.error('대댓글 작성 중 오류 발생:', error);
if (error.response) {
- // console.error('서버 응답 에러:', error.response.data);
alert("오류가 발생했습니다.");
}
alert("오류가 발생했습니다.");
@@ -504,11 +496,10 @@ const editComment = (comment) => {
if (isMyComment) {
// 본인 댓글이면 바로 수정 모드 활성화
- targetComment.isEditTextarea = true;
+ targetComment.isEditTextarea = !targetComment.isEditTextarea;
} else if (isAnonymous) {
// 익명 댓글이면 비밀번호 입력창 띄우기
toggleCommentPassword(comment, "edit");
-
} else {
// console.log("다른 사용자 댓글 - 수정 불가");
alert("수정이 불가능합니다");
@@ -545,8 +536,6 @@ const toggleCommentPassword = (comment, button) => {
lastCommentClickedButton.value = button;
};
-
-
const togglePassword = (button) => {
if (lastClickedButton.value === button) {
isPassword.value = !isPassword.value;
@@ -562,7 +551,6 @@ const submitPassword = async () => {
passwordAlert.value = "비밀번호를 입력해주세요.";
return;
}
- // console.log("📌 요청 시작: submitPassword 실행됨");
try {
const response = await axios.post(`board/${currentBoardId.value}/password`, {
@@ -674,7 +662,7 @@ const deletePost = async () => {
// 댓글 삭제 (대댓글 포함)
const deleteReplyComment = async (comment) => {
if (!confirm("정말 이 댓글을 삭제하시겠습니까?")) return;
- // console.log("댓글 ID:", comment);
+ console.log("댓글 수정, 대댓글도?");
try {
const response = await axios.delete(`board/comment/${comment.commentId}`, {