LET'S FUCKING GOOOOO #18

Merged
FernandoJVideira merged 33 commits from develop into master 2026-01-23 21:47:54 +00:00
Showing only changes of commit 90e0624cfa - Show all commits
+3 -3
View File
@@ -280,12 +280,12 @@ const editText = ref('');
const toggleHide = async (comment) => { const toggleHide = async (comment) => {
try { try {
console.log(comment)
comment.hidden = !comment.hidden; comment.hidden = !comment.hidden;
await $fetch(`${props.api}/comments/${comment.id}`, { await $fetch(`${props.api}/comments/${comment.id}`, {
method: 'PATCH', method: 'PATCH',
headers: { Authorization: `Bearer ${props.token}` }, headers: { Authorization: `Bearer ${props.token}` },
body: { is_hidden: comment.hidden }
}); });
notifications.success(comment.hidden ? "Comment hidden" : "Comment visible"); notifications.success(comment.hidden ? "Comment hidden" : "Comment visible");
@@ -310,13 +310,13 @@ const handleEditSubmit = async (comment) => {
submitting.value = true; submitting.value = true;
try { try {
const updatedComment = await $fetch(`${props.api}/comments/${comment.id}`, { await $fetch(`${props.api}/comments/${comment.id}`, {
method: 'PUT', method: 'PUT',
headers: { Authorization: `Bearer ${props.token}` }, headers: { Authorization: `Bearer ${props.token}` },
body: { content: editText.value } body: { content: editText.value }
}); });
comment.content = updatedComment.content; comment.content = editText.value;
editingCommentId.value = null; editingCommentId.value = null;
notifications.success("Comment updated!"); notifications.success("Comment updated!");
} catch (err) { } catch (err) {