From 90e0624cfa35759e3c7c48d6c13bae4aa048fbef Mon Sep 17 00:00:00 2001 From: Edd Date: Fri, 23 Jan 2026 20:30:00 +0000 Subject: [PATCH] final frontend part 2 --- app/components/post/PostDetail.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/components/post/PostDetail.vue b/app/components/post/PostDetail.vue index 782121d..7410a7f 100644 --- a/app/components/post/PostDetail.vue +++ b/app/components/post/PostDetail.vue @@ -280,12 +280,12 @@ const editText = ref(''); const toggleHide = async (comment) => { try { - console.log(comment) comment.hidden = !comment.hidden; await $fetch(`${props.api}/comments/${comment.id}`, { method: 'PATCH', headers: { Authorization: `Bearer ${props.token}` }, + body: { is_hidden: comment.hidden } }); notifications.success(comment.hidden ? "Comment hidden" : "Comment visible"); @@ -310,13 +310,13 @@ const handleEditSubmit = async (comment) => { submitting.value = true; try { - const updatedComment = await $fetch(`${props.api}/comments/${comment.id}`, { + await $fetch(`${props.api}/comments/${comment.id}`, { method: 'PUT', headers: { Authorization: `Bearer ${props.token}` }, body: { content: editText.value } }); - comment.content = updatedComment.content; + comment.content = editText.value; editingCommentId.value = null; notifications.success("Comment updated!"); } catch (err) {