refactor, add post edit and delete, merge APIs, add not found view
Signed-off-by: Nicolas Froger <nicolas@kektus.xyz>
This commit is contained in:
parent
2647ac244d
commit
efde8738a8
23 changed files with 803 additions and 343 deletions
|
|
@ -13,27 +13,35 @@ import {
|
|||
TableRow
|
||||
} from '@/components/ui/table/index.js'
|
||||
|
||||
const adminPostsStore = useAdminPostsStore();
|
||||
const adminPostsStore = useAdminPostsStore()
|
||||
|
||||
onMounted(() => {
|
||||
adminPostsStore.fetchPosts();
|
||||
adminPostsStore.fetchPosts()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="grid grid-cols-3 grid-rows-1 mt-28 sm:mt-20 w-full justify-center items-center gap-4">
|
||||
<div class="col-span-3 col-start-1 lg:col-span-1 lg:col-start-2 mx-5 lg:mx-0">
|
||||
<h1 class="scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl mb-6">
|
||||
Admin
|
||||
</h1>
|
||||
<h1 class="scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl mb-6">Admin</h1>
|
||||
<h2
|
||||
class="scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight transition-colors first:mt-0"
|
||||
>
|
||||
Localisation
|
||||
</h2>
|
||||
<RouterLink to="/admin/send-location">
|
||||
<Button class="mb-6 mr-2">
|
||||
<Button class="my-4">
|
||||
<MapPin class="mr-2" />
|
||||
Envoyer localisation
|
||||
</Button>
|
||||
</RouterLink>
|
||||
<h2
|
||||
class="scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight transition-colors first:mt-0"
|
||||
>
|
||||
Posts
|
||||
</h2>
|
||||
<RouterLink to="/admin/post/create">
|
||||
<Button class="mb-6">
|
||||
<Button class="my-4">
|
||||
<CirclePlus class="mr-2" />
|
||||
Créer
|
||||
</Button>
|
||||
|
|
@ -56,11 +64,13 @@ onMounted(() => {
|
|||
<TableCell>{{ post.country }}</TableCell>
|
||||
<TableCell>
|
||||
<div class="flex gap-2">
|
||||
<Button>
|
||||
<Pencil size="16"/>
|
||||
</Button>
|
||||
<Button>
|
||||
<Trash size="16"/>
|
||||
<RouterLink :to="{ name: 'admin_edit_post', params: { id: post.id } }">
|
||||
<Button>
|
||||
<Pencil size="16" />
|
||||
</Button>
|
||||
</RouterLink>
|
||||
<Button @click="adminPostsStore.deletePost(post.id)">
|
||||
<Trash size="16" />
|
||||
</Button>
|
||||
</div>
|
||||
</TableCell>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue