feat: 댓글 신고 블라인드 관리자 해제 버튼
CI / build (push) Failing after 11m47s

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
ByungCheol
2026-06-28 18:17:11 +09:00
parent 59f38b3348
commit 8be7072614
2 changed files with 23 additions and 0 deletions
+4
View File
@@ -65,6 +65,10 @@ export const boardApi = {
reportComment(commentId) { reportComment(commentId) {
return http.post(`/board/comments/${commentId}/report`) return http.post(`/board/comments/${commentId}/report`)
}, },
// 댓글 블라인드 해제 (관리자)
unblockComment(commentId) {
return http.post(`/board/comments/${commentId}/unblock`)
},
block(id, reason) { block(id, reason) {
return http.post(`/board/posts/${id}/block`, { reason }) return http.post(`/board/posts/${id}/block`, { reason })
}, },
+19
View File
@@ -147,6 +147,14 @@ async function reportComment(c) {
alert(e.response?.data?.message || '신고에 실패했습니다.') alert(e.response?.data?.message || '신고에 실패했습니다.')
} }
} }
async function unblockComment(c) {
try {
await boardApi.unblockComment(c.id)
await refreshComments()
} catch (e) {
alert(e.response?.data?.message || '해제에 실패했습니다.')
}
}
// 댓글 목록만 새로고침 (다른 사람이 단 댓글·추천 반영) // 댓글 목록만 새로고침 (다른 사람이 단 댓글·추천 반영)
const refreshingComments = ref(false) const refreshingComments = ref(false)
@@ -366,6 +374,10 @@ onMounted(load)
v-if="!isAdmin && auth.user && c.authorId !== auth.user.id" v-if="!isAdmin && auth.user && c.authorId !== auth.user.id"
type="button" class="creport" @click="reportComment(c)" type="button" class="creport" @click="reportComment(c)"
>🚩 신고</button> >🚩 신고</button>
<button
v-if="isAdmin && c.blocked"
type="button" class="cunblock" @click="unblockComment(c)"
>블라인드 해제</button>
</div> </div>
</template> </template>
</li> </li>
@@ -662,6 +674,13 @@ button.notice-btn {
color: #c0392b; color: #c0392b;
opacity: 0.85; opacity: 0.85;
} }
.cunblock {
padding: 0.2rem 0.6rem;
font-size: 0.8rem;
border-radius: 999px;
border-color: hsla(160, 100%, 37%, 1);
color: hsla(160, 100%, 37%, 1);
}
.comment-votes { .comment-votes {
display: flex; display: flex;
gap: 0.4rem; gap: 0.4rem;