diff --git a/app/pages/profile/index.vue b/app/pages/profile/index.vue index 2b46ab2..37682bc 100644 --- a/app/pages/profile/index.vue +++ b/app/pages/profile/index.vue @@ -382,18 +382,6 @@ leave-from-class="transform opacity-100 translate-y-0" leave-to-class="transform opacity-0 translate-y-2">
- -
-

- Biography -

-

- {{ userProfile.biography }} -

-
-

Recent Publications @@ -457,6 +445,8 @@ class="group bg-white dark:bg-gray-900 border dark:border-gray-800 rounded-xl p-5 shadow-sm hover:border-blue-500/50 transition-all cursor-pointer mb-4" @click="fetchPostDetail(post.id)"> + +
@@ -489,10 +479,58 @@

+
+ + +
+ +
+ + +
+ + +
@@ -809,6 +847,29 @@ const votePost = async (targetPost, direction) => { } }; +const confirmHide = async (post) => { + if (!post) return; + + const confirmed = confirm(`Are you sure you want to hide the post titled "${post.title}"?`); + + if (!confirmed) return; + + try { + await $fetch(`${api}/publications/${post.id}`, { + method: 'DELETE', + headers: { Authorization: `Bearer ${token.value}` } + }); + + userProfile.value.publications = userProfile.value.publications.filter(p => p.id !== post.id); + + alert("Post deleted successfully."); + + } catch (error) { + console.error("Delete failed", error); + alert("Failed to delete the post."); + } +}; + // --- Redirects --- const goToCreatePost = () => { console.log("Navigating to create post modal...");