|
|
|
@ -3,8 +3,6 @@ definePageMeta({
|
|
|
|
middleware: ['auth'],
|
|
|
|
middleware: ['auth'],
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
import { z } from 'zod'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const posts = usePosts()
|
|
|
|
const posts = usePosts()
|
|
|
|
const openCreatePostModal = ref<Boolean>(false)
|
|
|
|
const openCreatePostModal = ref<Boolean>(false)
|
|
|
|
|
|
|
|
|
|
|
|
@ -12,11 +10,6 @@ const getPosts = async () => {
|
|
|
|
await fetchPosts()
|
|
|
|
await fetchPosts()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const logout = async () => {
|
|
|
|
|
|
|
|
await userLogout()
|
|
|
|
|
|
|
|
useRouter().push('/login')
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const toggleCreatePostModal = () => {
|
|
|
|
const toggleCreatePostModal = () => {
|
|
|
|
openCreatePostModal.value = !openCreatePostModal.value
|
|
|
|
openCreatePostModal.value = !openCreatePostModal.value
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -34,8 +27,7 @@ onMounted(() => {
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<Header />
|
|
|
|
<Header />
|
|
|
|
<div class="mt-16 flex w-full items-center justify-center">
|
|
|
|
<div class="mt-16 flex w-full items-center justify-center">
|
|
|
|
<div class="flex w-1/2 flex-col gap-4 px-4 pb-10 pt-4 2xl:w-1/3">
|
|
|
|
<div class="flex w-full max-w-2xl flex-col gap-4 px-4 pb-10 pt-4">
|
|
|
|
<button @click="getUserPosts()"> User Posts </button>
|
|
|
|
|
|
|
|
<div v-if="posts" v-for="post in posts">
|
|
|
|
<div v-if="posts" v-for="post in posts">
|
|
|
|
<PostCard :title="post.title" :description="post.description" />
|
|
|
|
<PostCard :title="post.title" :description="post.description" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@ -43,7 +35,7 @@ onMounted(() => {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<button @click="createPost()"
|
|
|
|
<button @click="createPost()"
|
|
|
|
class="fixed bottom-12 right-12 flex items-center justify-center gap-2 rounded-full bg-blue-500 p-4">
|
|
|
|
class="fixed bottom-6 right-6 flex items-center justify-center gap-2 rounded-full bg-blue-500 p-4">
|
|
|
|
<Icon name="plus" />
|
|
|
|
<Icon name="plus" />
|
|
|
|
Create Post
|
|
|
|
Create Post
|
|
|
|
</button>
|
|
|
|
</button>
|
|
|
|
|