주석 삭제
This commit is contained in:
parent
d954a1b68c
commit
d1c91b30df
@ -165,7 +165,6 @@ const handleEditClick = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleReplyEditClick = (event) => {
|
const handleReplyEditClick = (event) => {
|
||||||
console.log("📌 editClick 이벤트 실행됨! 전달된 데이터:", event);
|
|
||||||
emit('editClick', event);
|
emit('editClick', event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
<div v-if="!unknown" class="avatar me-2">
|
<div v-if="!unknown" class="avatar me-2">
|
||||||
<img src="/img/avatars/2.png" alt="Avatar" class="rounded-circle" />
|
<img src="/img/avatars/2.png" alt="Avatar" class="rounded-circle" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="me-2">
|
<div class="me-2">
|
||||||
<h6 class="mb-0">{{ profileName }}</h6>
|
<h6 class="mb-0">{{ profileName }}</h6>
|
||||||
<div class="profile-detail">
|
<div class="profile-detail">
|
||||||
@ -94,7 +95,7 @@ const props = defineProps({
|
|||||||
isLike: {
|
isLike: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(['updateReaction', 'editClick', 'deleteClick']);
|
const emit = defineEmits(['updateReaction', 'editClick', 'deleteClick']);
|
||||||
@ -117,6 +118,10 @@ const handleUpdateReaction = (reactionData) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getProfileImage = (profilePath) => {
|
||||||
|
return profilePath && profilePath.trim() ? `${baseUrl}upload/img/profile/${profilePath}` : defaultProfile;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@ -195,10 +195,7 @@ const fetchGeneralPosts = async (page = 1) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (data?.data) {
|
if (data?.data) {
|
||||||
// console.log(data)
|
const totalPosts = data.data.total;
|
||||||
const totalPosts = data.data.total; // 전체 게시물 개수 받아오기
|
|
||||||
|
|
||||||
// console.log('📌 API 응답 데이터:', data.data);
|
|
||||||
|
|
||||||
generalList.value = data.data.list.map((post, index) => ({
|
generalList.value = data.data.list.map((post, index) => ({
|
||||||
realId: post.id,
|
realId: post.id,
|
||||||
|
|||||||
@ -76,13 +76,7 @@
|
|||||||
@updateReaction="handleUpdateReaction"
|
@updateReaction="handleUpdateReaction"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<!-- <p>현재 로그인한 사용자 ID: {{ currentUserId }}</p>
|
|
||||||
<p>게시글 작성자: {{ authorId }}</p>
|
|
||||||
<p>isAuthor 값: {{ isAuthor }}</p> -->
|
|
||||||
<!-- <p>use이미지:{{userStore.user.img}}</p> -->
|
|
||||||
<!-- <img :src="`http://localhost:10325/upload/img/profile/${userStore.user.profile}`" alt="Profile Image" class="w-px-40 h-auto rounded-circle"/> -->
|
|
||||||
|
|
||||||
|
|
||||||
<!-- 첨부파일 목록 -->
|
<!-- 첨부파일 목록 -->
|
||||||
<!-- <ul v-if="attachments.length" class="attachments mt-4 list-unstyled">
|
<!-- <ul v-if="attachments.length" class="attachments mt-4 list-unstyled">
|
||||||
<li v-for="(attachment, index) in attachments" :key="index" class="mb-2">
|
<li v-for="(attachment, index) in attachments" :key="index" class="mb-2">
|
||||||
@ -98,7 +92,6 @@
|
|||||||
:passwordAlert="passwordAlert"
|
:passwordAlert="passwordAlert"
|
||||||
@submitComment="handleCommentSubmit"
|
@submitComment="handleCommentSubmit"
|
||||||
/>
|
/>
|
||||||
<!-- <BoardCommentArea :profileName="profileName" :unknown="unknown" /> -->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 댓글 목록 -->
|
<!-- 댓글 목록 -->
|
||||||
@ -173,7 +166,6 @@ const commentsWithAuthStatus = computed(() => {
|
|||||||
isCommentAuthor: reply.authorId === currentUserId.value,
|
isCommentAuthor: reply.authorId === currentUserId.value,
|
||||||
}))
|
}))
|
||||||
}));
|
}));
|
||||||
// console.log("✅ commentsWithAuthStatus 업데이트됨:", updatedComments);
|
|
||||||
return updatedComments;
|
return updatedComments;
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -210,20 +202,12 @@ const fetchBoardDetails = async () => {
|
|||||||
const response = await axios.get(`board/${currentBoardId.value}`);
|
const response = await axios.get(`board/${currentBoardId.value}`);
|
||||||
const data = response.data.data;
|
const data = response.data.data;
|
||||||
|
|
||||||
// console.log(data)
|
|
||||||
|
|
||||||
// API 응답 데이터 반영
|
// API 응답 데이터 반영
|
||||||
// const boardDetail = data.boardDetail || {};
|
// const boardDetail = data.boardDetail || {};
|
||||||
|
|
||||||
profileName.value = data.author || '익명';
|
profileName.value = data.author || '익명';
|
||||||
|
|
||||||
// 익명확인하고 싶을때
|
|
||||||
// profileName.value = '익명';
|
|
||||||
|
|
||||||
// console.log("📌 게시글 작성자:", profileName.value); // 작성자 이름 출력
|
|
||||||
// console.log("🔍 익명 여부 (unknown.value):", unknown.value); // 익명 여부 확인
|
|
||||||
|
|
||||||
|
|
||||||
authorId.value = data.authorId; //게시글 작성자 id
|
authorId.value = data.authorId; //게시글 작성자 id
|
||||||
boardTitle.value = data.title || '제목 없음';
|
boardTitle.value = data.title || '제목 없음';
|
||||||
boardContent.value = data.content || '';
|
boardContent.value = data.content || '';
|
||||||
@ -245,7 +229,6 @@ const handleUpdateReaction = async ({ boardId, commentId, isLike, isDislike }) =
|
|||||||
await axios.post(`/board/${boardId}/${commentId}/reaction`, {
|
await axios.post(`/board/${boardId}/${commentId}/reaction`, {
|
||||||
LOCBRDSEQ: boardId, // 게시글 id
|
LOCBRDSEQ: boardId, // 게시글 id
|
||||||
LOCCMTSEQ: commentId, //댓글 id
|
LOCCMTSEQ: commentId, //댓글 id
|
||||||
// MEMBERSEQ: 1, // 멤버아이디 지금은 1 나중에 수정해야함
|
|
||||||
LOCGOBGOD: isLike ? 'T' : 'F',
|
LOCGOBGOD: isLike ? 'T' : 'F',
|
||||||
LOCGOBBAD: isDislike ? 'T' : 'F'
|
LOCGOBBAD: isDislike ? 'T' : 'F'
|
||||||
});
|
});
|
||||||
@ -258,13 +241,9 @@ const handleUpdateReaction = async ({ boardId, commentId, isLike, isDislike }) =
|
|||||||
|
|
||||||
likeClicked.value = isLike;
|
likeClicked.value = isLike;
|
||||||
dislikeClicked.value = isDislike;
|
dislikeClicked.value = isDislike;
|
||||||
// console.log(updatedData)
|
|
||||||
|
|
||||||
// console.log("갱신된 데이터:", updatedData);
|
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
alert('오류가 발생했습니다.');
|
alert('오류가 발생했습니다.');
|
||||||
// console.log('반응을 업데이트하는 중 오류가 발생했습니다.');
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -281,13 +260,10 @@ const handleCommentReaction = async ({ boardId, commentId, isLike, isDislike })
|
|||||||
LOCGOBBAD: isDislike ? 'T' : 'F'
|
LOCGOBBAD: isDislike ? 'T' : 'F'
|
||||||
});
|
});
|
||||||
|
|
||||||
// console.log("댓글 좋아요 API 응답 데이터:", response.data);
|
|
||||||
|
|
||||||
await fetchComments();
|
await fetchComments();
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
alert('오류가 발생했습니다.');
|
alert('오류가 발생했습니다.');
|
||||||
// console.log('댓글 반응을 업데이트하는 중 오류 발생');
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -302,8 +278,6 @@ const fetchComments = async (page = 1) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// console.log(response.data.data)
|
|
||||||
|
|
||||||
const commentsList = response.data.data.list.map(comment => ({
|
const commentsList = response.data.data.list.map(comment => ({
|
||||||
commentId: comment.LOCCMTSEQ, // 댓글 ID
|
commentId: comment.LOCCMTSEQ, // 댓글 ID
|
||||||
boardId: comment.LOCBRDSEQ,
|
boardId: comment.LOCBRDSEQ,
|
||||||
@ -329,8 +303,6 @@ const fetchComments = async (page = 1) => {
|
|||||||
params: { LOCCMTPNT: comment.commentId }
|
params: { LOCCMTPNT: comment.commentId }
|
||||||
});
|
});
|
||||||
|
|
||||||
// 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 => ({
|
||||||
author: reply.author || '익명',
|
author: reply.author || '익명',
|
||||||
@ -370,18 +342,15 @@ const fetchComments = async (page = 1) => {
|
|||||||
navigateLastPage: response.data.data.navigateLastPage // 페이지네이션에서 마지막 페이지 번호
|
navigateLastPage: response.data.data.navigateLastPage // 페이지네이션에서 마지막 페이지 번호
|
||||||
};
|
};
|
||||||
|
|
||||||
// console.log("📌 댓글 목록:", comments.value);
|
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
alert('오류가 발생했습니다.');
|
alert('오류가 발생했습니다.');
|
||||||
// alert('댓글 목록 불러오기 오류:', error);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 댓글 작성
|
// 댓글 작성
|
||||||
const handleCommentSubmit = async (data) => {
|
const handleCommentSubmit = async (data) => {
|
||||||
if (!data) {
|
if (!data) {
|
||||||
console.error("handleCommentSubmit: data가 undefined입니다.");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -432,8 +401,8 @@ const handleCommentReply = async (reply) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
if (response.data.code === 200) { // 서버 응답 코드도 확인
|
if (response.data.code === 200) {
|
||||||
await fetchComments(); // 댓글 목록 새로고침
|
await fetchComments();
|
||||||
} else {
|
} else {
|
||||||
alert('대댓글 작성을 실패했습니다.');
|
alert('대댓글 작성을 실패했습니다.');
|
||||||
}
|
}
|
||||||
@ -443,7 +412,6 @@ const handleCommentReply = async (reply) => {
|
|||||||
alert("오류가 발생했습니다.");
|
alert("오류가 발생했습니다.");
|
||||||
}
|
}
|
||||||
alert("오류가 발생했습니다.");
|
alert("오류가 발생했습니다.");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -482,41 +450,33 @@ const findCommentById = (commentId, commentsList) => {
|
|||||||
|
|
||||||
// 댓글 수정 버튼 클릭
|
// 댓글 수정 버튼 클릭
|
||||||
const editComment = (comment) => {
|
const editComment = (comment) => {
|
||||||
// 부모 또는 대댓글을 찾아서 가져오기
|
|
||||||
const targetComment = findCommentById(comment.commentId, comments.value);
|
const targetComment = findCommentById(comment.commentId, comments.value);
|
||||||
|
|
||||||
if (!targetComment) {
|
if (!targetComment) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 댓글 작성자가 현재 로그인한 사용자와 동일한지 확인
|
|
||||||
const isMyComment = comment.authorId === currentUserId.value;
|
const isMyComment = comment.authorId === currentUserId.value;
|
||||||
const isAnonymous = comment.author === "익명";
|
const isAnonymous = comment.author === "익명";
|
||||||
|
|
||||||
if (isMyComment) {
|
if (isMyComment) {
|
||||||
// 본인 댓글이면 바로 수정 모드 활성화
|
|
||||||
targetComment.isEditTextarea = !targetComment.isEditTextarea;
|
targetComment.isEditTextarea = !targetComment.isEditTextarea;
|
||||||
} else if (isAnonymous) {
|
} else if (isAnonymous) {
|
||||||
// 익명 댓글이면 비밀번호 입력창 띄우기
|
|
||||||
toggleCommentPassword(comment, "edit");
|
toggleCommentPassword(comment, "edit");
|
||||||
} else {
|
} else {
|
||||||
// console.log("다른 사용자 댓글 - 수정 불가");
|
|
||||||
alert("수정이 불가능합니다");
|
alert("수정이 불가능합니다");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 댓글 삭제 버튼 클릭
|
// 댓글 삭제 버튼 클릭
|
||||||
const deleteComment = async (comment) => {
|
const deleteComment = async (comment) => {
|
||||||
// 익명 사용자인 경우
|
|
||||||
const isMyComment = comment.authorId === currentUserId.value;
|
const isMyComment = comment.authorId === currentUserId.value;
|
||||||
|
|
||||||
if (unknown.value && !isMyComment) {
|
if (unknown.value && !isMyComment) {
|
||||||
if (comment.isEditTextarea) {
|
if (comment.isEditTextarea) {
|
||||||
// 현재 수정 중이라면 수정 모드를 끄고, 삭제 비밀번호 입력창을 띄움
|
|
||||||
comment.isEditTextarea = false;
|
comment.isEditTextarea = false;
|
||||||
comment.isCommentPassword = true;
|
comment.isCommentPassword = true;
|
||||||
} else {
|
} else {
|
||||||
// 수정 중이 아니면 기존의 삭제 비밀번호 입력창을 띄우는 로직 실행
|
|
||||||
toggleCommentPassword(comment, "delete");
|
toggleCommentPassword(comment, "delete");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -554,7 +514,7 @@ const submitPassword = async () => {
|
|||||||
try {
|
try {
|
||||||
const response = await axios.post(`board/${currentBoardId.value}/password`, {
|
const response = await axios.post(`board/${currentBoardId.value}/password`, {
|
||||||
LOCBRDPWD: password.value,
|
LOCBRDPWD: password.value,
|
||||||
LOCBRDSEQ: 288, // 나중에 현재 게시글 ID 사용해야함
|
LOCBRDSEQ: 288,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (response.data.code === 200 && response.data.data === true) {
|
if (response.data.code === 200 && response.data.data === true) {
|
||||||
@ -571,8 +531,6 @@ const submitPassword = async () => {
|
|||||||
passwordAlert.value = "비밀번호가 일치하지 않습니다.";
|
passwordAlert.value = "비밀번호가 일치하지 않습니다.";
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// console.log("📌 전체 오류:", error);
|
|
||||||
|
|
||||||
if (error.response) {
|
if (error.response) {
|
||||||
if (error.response.status === 401) {
|
if (error.response.status === 401) {
|
||||||
passwordAlert.value = "비밀번호가 일치하지 않습니다.";
|
passwordAlert.value = "비밀번호가 일치하지 않습니다.";
|
||||||
@ -589,11 +547,6 @@ const submitPassword = async () => {
|
|||||||
|
|
||||||
// 댓글 삭제 (비밀번호 확인 후)
|
// 댓글 삭제 (비밀번호 확인 후)
|
||||||
const submitCommentPassword = async (comment, password) => {
|
const submitCommentPassword = async (comment, password) => {
|
||||||
console.log('야야야')
|
|
||||||
|
|
||||||
console.log("비밀번호 :", password);
|
|
||||||
console.log("댓글 ID:", comment.commentId);
|
|
||||||
|
|
||||||
if (!password) {
|
if (!password) {
|
||||||
passwordCommentAlert.value = "비밀번호를 입력해주세요.";
|
passwordCommentAlert.value = "비밀번호를 입력해주세요.";
|
||||||
return;
|
return;
|
||||||
@ -602,12 +555,10 @@ const submitCommentPassword = async (comment, password) => {
|
|||||||
const targetComment = findCommentById(comment.commentId, comments.value);
|
const targetComment = findCommentById(comment.commentId, comments.value);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// console.log('서버로 비밀번호 확인 요청')
|
|
||||||
const response = await axios.post(`board/comment/${comment.commentId}/password`, {
|
const response = await axios.post(`board/comment/${comment.commentId}/password`, {
|
||||||
LOCCMTPWD: password,
|
LOCCMTPWD: password,
|
||||||
LOCCMTSEQ: comment.commentId,
|
LOCCMTSEQ: comment.commentId,
|
||||||
});
|
});
|
||||||
console.log("✅ 서버 응답 데이터:", response.data);
|
|
||||||
|
|
||||||
if (response.data.code === 200 && response.data.data === true) {
|
if (response.data.code === 200 && response.data.data === true) {
|
||||||
passwordCommentAlert.value = "";
|
passwordCommentAlert.value = "";
|
||||||
@ -622,9 +573,6 @@ const submitCommentPassword = async (comment, password) => {
|
|||||||
} else {
|
} else {
|
||||||
alert("수정 취소를 실패했습니다.");
|
alert("수정 취소를 실패했습니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 여기부분이 익명 수정 비밀번호 부분임!!!!!
|
|
||||||
|
|
||||||
} else if (lastCommentClickedButton.value === "delete") {
|
} else if (lastCommentClickedButton.value === "delete") {
|
||||||
passwordCommentAlert.value = "";
|
passwordCommentAlert.value = "";
|
||||||
|
|
||||||
@ -632,14 +580,12 @@ const submitCommentPassword = async (comment, password) => {
|
|||||||
}
|
}
|
||||||
lastCommentClickedButton.value = null;
|
lastCommentClickedButton.value = null;
|
||||||
} else {
|
} else {
|
||||||
// console.log("❌ 비밀번호가 틀림");
|
|
||||||
passwordCommentAlert.value = "비밀번호가 일치하지 않습니다.";
|
passwordCommentAlert.value = "비밀번호가 일치하지 않습니다.";
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// console.log("🚨 서버 요청 중 오류 발생:", error.response?.data || error);
|
if (error.response?.status === 401) {
|
||||||
// if (error.response?.status === 401) {
|
passwordCommentAlert.value = "비밀번호가 일치하지 않습니다";
|
||||||
// console.log("❌ 401 오류: 인증 실패 (비밀번호 불일치)");
|
}
|
||||||
// }
|
|
||||||
passwordCommentAlert.value = "비밀번호가 일치하지 않습니다";
|
passwordCommentAlert.value = "비밀번호가 일치하지 않습니다";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -677,17 +623,12 @@ const deleteReplyComment = async (comment) => {
|
|||||||
data: { LOCCMTSEQ: comment.commentId }
|
data: { LOCCMTSEQ: comment.commentId }
|
||||||
});
|
});
|
||||||
|
|
||||||
// console.log("서버 응답:", response.data);
|
|
||||||
|
|
||||||
if (response.data.code === 200) {
|
if (response.data.code === 200) {
|
||||||
// console.log("댓글 삭제 성공!");
|
|
||||||
await fetchComments();
|
await fetchComments();
|
||||||
} else {
|
} else {
|
||||||
// console.log("댓글 삭제 실패:", response.data.message);
|
|
||||||
alert("댓글 삭제에 실패했습니다.");
|
alert("댓글 삭제에 실패했습니다.");
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// console.log("댓글 삭제 중 오류 발생:", error);
|
|
||||||
alert("댓글 삭제 중 오류가 발생했습니다.");
|
alert("댓글 삭제 중 오류가 발생했습니다.");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -700,9 +641,6 @@ const handleSubmitEdit = async (comment, editedContent) => {
|
|||||||
LOCCMTRPY: editedContent
|
LOCCMTRPY: editedContent
|
||||||
});
|
});
|
||||||
|
|
||||||
// 수정 성공 시 업데이트
|
|
||||||
// comment.content = editedContent;
|
|
||||||
// comment.isEditTextarea = false; f
|
|
||||||
if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
|
|
||||||
const targetComment = findCommentById(comment.commentId, comments.value);
|
const targetComment = findCommentById(comment.commentId, comments.value);
|
||||||
@ -710,15 +648,12 @@ const handleSubmitEdit = async (comment, editedContent) => {
|
|||||||
targetComment.content = editedContent; // 댓글 내용 업데이트
|
targetComment.content = editedContent; // 댓글 내용 업데이트
|
||||||
targetComment.isEditTextarea = false; // 수정 모드 닫기
|
targetComment.isEditTextarea = false; // 수정 모드 닫기
|
||||||
} else {
|
} else {
|
||||||
// console.warn("❌ 수정할 댓글을 찾을 수 없음");
|
|
||||||
alert("수정할 댓글을 찾을 수 없습니다.");
|
alert("수정할 댓글을 찾을 수 없습니다.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// console.log("❌ 댓글 수정 실패:", response.data);
|
|
||||||
alert("댓글 수정 실패했습니다.");
|
alert("댓글 수정 실패했습니다.");
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// console.error("댓글 수정 중 오류 발생:", error);
|
|
||||||
alert("댓글 수정 중 오류 발생했습니다.");
|
alert("댓글 수정 중 오류 발생했습니다.");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -728,10 +663,8 @@ const handleCancelEdit = (comment) => {
|
|||||||
const targetComment = findCommentById(comment.commentId, comments.value);
|
const targetComment = findCommentById(comment.commentId, comments.value);
|
||||||
|
|
||||||
if (targetComment) {
|
if (targetComment) {
|
||||||
// console.log("✅ 원본 데이터 찾음, 수정 취소 처리 가능:", targetComment);
|
|
||||||
targetComment.isEditTextarea = false;
|
targetComment.isEditTextarea = false;
|
||||||
} else {
|
} else {
|
||||||
// console.error("❌ 원본 데이터 찾을 수 없음, 수정 취소 실패");
|
|
||||||
alert("수정 취소를 실패했습니다.");
|
alert("수정 취소를 실패했습니다.");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -754,7 +687,7 @@ const handleCommentDeleted = (deletedCommentId) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2대댓글 삭제
|
// 대댓글 삭제
|
||||||
for (let parent of comments.value) {
|
for (let parent of comments.value) {
|
||||||
const childIndex = parent.children.findIndex(child => child.commentId === deletedCommentId);
|
const childIndex = parent.children.findIndex(child => child.commentId === deletedCommentId);
|
||||||
if (childIndex !== -1) {
|
if (childIndex !== -1) {
|
||||||
@ -762,11 +695,8 @@ const handleCommentDeleted = (deletedCommentId) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.error("❌ 삭제할 댓글을 찾을 수 없음:", deletedCommentId);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// 날짜
|
// 날짜
|
||||||
const formattedDate = (dateString) => {
|
const formattedDate = (dateString) => {
|
||||||
if (!dateString) return "날짜 없음";
|
if (!dateString) return "날짜 없음";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user