Merge branch 'boardmodify3'

This commit is contained in:
nevermoregb 2025-03-11 10:38:47 +09:00
commit 61935cfb68

View File

@ -157,7 +157,7 @@
const toastStore = useToastStore(); const toastStore = useToastStore();
const currentBoardId = ref(Number(route.params.id)); const currentBoardId = ref(Number(route.params.id));
const unknown = computed(() => profileName.value === '익명'); const unknown = computed(() => profileName.value === '익명');
const currentUserId = computed(() => userStore.user.id); // id const currentUserId = computed(() => userStore?.user?.id); // id
const authorId = ref(''); // id const authorId = ref(''); // id
const isAuthor = computed(() => currentUserId.value === authorId.value); const isAuthor = computed(() => currentUserId.value === authorId.value);
@ -233,7 +233,6 @@
}; };
// //
const fetchBoardDetails = async () => { const fetchBoardDetails = async () => {
try {
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;
@ -248,9 +247,6 @@
attachment.value = data.hasAttachment || null; attachment.value = data.hasAttachment || null;
commentNum.value = data.commentCount || 0; commentNum.value = data.commentCount || 0;
attachments.value = data.attachments || []; attachments.value = data.attachments || [];
} catch (error) {
alert('게시물 데이터를 불러오는 중 오류가 발생했습니다.');
}
}; };
// , // ,
@ -280,7 +276,6 @@
const handleCommentReaction = async ({ boardId, commentId, isLike, isDislike }) => { const handleCommentReaction = async ({ boardId, commentId, isLike, isDislike }) => {
if (!commentId) return; // ID if (!commentId) return; // ID
try {
const response = await axios.post(`/board/${boardId}/${commentId}/reaction`, { const response = await axios.post(`/board/${boardId}/${commentId}/reaction`, {
LOCBRDSEQ: boardId, // ID LOCBRDSEQ: boardId, // ID
LOCCMTSEQ: commentId, // ID LOCCMTSEQ: commentId, // ID
@ -289,14 +284,10 @@
}); });
await fetchComments(); await fetchComments();
} catch (error) {
alert('오류가 발생했습니다.');
}
}; };
// //
const fetchComments = async (page = 1) => { const fetchComments = async (page = 1) => {
try {
// //
const response = await axios.get(`board/${currentBoardId.value}/comments`, { const response = await axios.get(`board/${currentBoardId.value}/comments`, {
params: { params: {
@ -368,9 +359,6 @@
navigateFirstPage: response.data.data.navigateFirstPage, // navigateFirstPage: response.data.data.navigateFirstPage, //
navigateLastPage: response.data.data.navigateLastPage, // navigateLastPage: response.data.data.navigateLastPage, //
}; };
} catch (error) {
alert('오류가 발생했습니다.');
}
}; };
// //
@ -453,7 +441,7 @@
// //
const deleteClick = unknown => { const deleteClick = unknown => {
if (unknown) { if (unknown.value) {
togglePassword('delete'); togglePassword('delete');
} else { } else {
deletePost(); deletePost();