댓글 익명 체크 수정 완료

This commit is contained in:
kimdaae328 2025-02-27 16:23:45 +09:00
parent ffabb284fa
commit b02d99e4b1
2 changed files with 9 additions and 8 deletions

View File

@ -51,10 +51,7 @@
<!-- 답변 쓰기 버튼 -->
<div class="ms-auto mt-3 mt-md-0">
<button class="btn btn-primary" @click="handleCommentSubmit">
<!-- <i class="icon-base bx bx-check"></i> -->
확인
</button>
<SaveBtn class="btn btn-primary" @click="handleCommentSubmit"></SaveBtn>
</div>
</div>
</div>
@ -63,6 +60,7 @@
<script setup>
import { ref, defineEmits, defineProps, computed, watch } from 'vue';
import SaveBtn from '../button/SaveBtn.vue';
const props = defineProps({
unknown: {
@ -90,6 +88,7 @@ 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 : '',

View File

@ -106,7 +106,7 @@
<BoardCommentList
:unknown="unknown"
:comments="commentsWithAuthStatus"
:isCommentPassword="Boolean(isCommentPassword)"
:isCommentPassword="isCommentPassword"
:isEditTextarea="isEditTextarea"
:passwordCommentAlert="passwordCommentAlert"
@editClick="editComment"
@ -320,6 +320,8 @@ const fetchComments = async (page = 1) => {
children: [], //
}));
commentsList.sort((a, b) => b.createdAtRaw - a.createdAtRaw);
for (const comment of commentsList) {
if (!comment.commentId) continue;
@ -378,13 +380,13 @@ const fetchComments = async (page = 1) => {
};
//
const handleCommentSubmit = async (data, isCheck) => {
const handleCommentSubmit = async (data) => {
if (!data) {
console.error("handleCommentSubmit: data가 undefined입니다.");
return;
}
const { comment, password } = data;
const { comment, password, isCheck } = data;
if (!comment || comment.trim() === "") {
commentAlert.value = '댓글을 입력해주세요.';
@ -404,7 +406,7 @@ const handleCommentSubmit = async (data, isCheck) => {
LOCCMTRPY: comment,
LOCCMTPWD: isCheck ? password : '',
LOCCMTPNT: 1,
LOCBRDTYP: unknown.value ? "300102" : null
LOCBRDTYP: isCheck ? "300102" : null
});
if (response.status === 200) {