댓글 비밀번호 진행중

This commit is contained in:
kimdaae328 2025-02-21 09:52:10 +09:00
parent 62361b7ae9
commit 3f4743cac2
2 changed files with 17 additions and 13 deletions

View File

@ -31,7 +31,7 @@
<div class="mt-6">
<template v-if="comment.isEditTextarea">
<textarea v-model="editedContent" class="form-control"></textarea>
<textarea v-model="localEditedContent" class="form-control"></textarea>
<div class="mt-2 d-flex justify-content-end">
<button class="btn btn-secondary me-2" @click="$emit('cancelEdit', comment)">취소</button>
<button class="btn btn-primary" @click="$emit('submitEdit', comment, editedContent)">수정</button>
@ -110,7 +110,7 @@ const props = defineProps({
const emit = defineEmits(['submitComment', 'updateReaction', 'editClick', 'deleteClick', 'submitPassword', 'submitEdit', 'cancelEdit']);
const password = ref('');
const localEditedContent = ref(props.editedContent);
//
const isComment = ref(false);
@ -142,16 +142,20 @@ const logPasswordAndEmit = () => {
emit('submitPassword', props.comment, password.value);
};
watch(() => props.editedContent, (newValue) => {
localEditedContent.value = newValue;
});
//
// const cancelEdit = () => {
// isEditTextarea.value = false;
// };
//
// const submitEdit = () => {
// emit('submitComment', { commentId: props.comment.commentId, content: editedContent.value });
// isEditTextarea.value = false; //
// };
const submitEdit = () => {
emit('submitComment', { commentId: props.comment.commentId, content: editedContent.value });
isEditTextarea.value = false; //
};
</script>

View File

@ -543,8 +543,8 @@ const submitCommentPassword = async (comment, password) => {
return;
}
console.log('코멘트아이디:', comment.commentId, '비번:', password)
comment.isEditTextarea = true;
// console.log(':', comment.commentId, ':', password)
// comment.isEditTextarea = true;
//
try {
@ -553,15 +553,15 @@ const submitCommentPassword = async (comment, password) => {
LOCCMTSEQ: comment.commentId,
});
console.log("응답!!!!!!!!", response); //
console.log("응답 데이터:", response.data);
// console.log("!!!!!!!!", response); //
// console.log(" :", response.data);
if (response.data.code === 200 && response.data.data === true) {
console.log('되는거니')
// deleteComment()
// // password.value = '';
// // isPassword.value = false;
// // isEditTextarea.value = true;
password.value = '';
isPassword.value = false;
comment.isEditTextarea.value = true;
} else {
passwordAlert.value = "비밀번호가 일치하지 않습니다.";
}