read content notification on click
This commit is contained in:
parent
1fae3dd414
commit
495e1c024e
7 changed files with 25 additions and 16 deletions
|
|
@ -2,10 +2,7 @@
|
|||
<article
|
||||
class="notification | bg-white rounded-lg | p-16 | flow"
|
||||
data-type="content"
|
||||
@click="
|
||||
read(notification);
|
||||
router.push(notification.location.page.uri);
|
||||
"
|
||||
@click="readNotification()"
|
||||
title="Aller au contenu"
|
||||
>
|
||||
<header>
|
||||
|
|
@ -16,7 +13,7 @@
|
|||
>Contenu</strong
|
||||
>
|
||||
<span class="notification__client | text-grey-700">{{
|
||||
notification.location.project.title
|
||||
notification.project.title
|
||||
}}</span>
|
||||
<time
|
||||
datetime=""
|
||||
|
|
@ -37,8 +34,17 @@
|
|||
<script setup>
|
||||
import { useRouter } from "vue-router";
|
||||
import { useNotificationsStore } from "../../stores/notifications";
|
||||
import { useUserStore } from "../../stores/user";
|
||||
import { useApiStore } from "../../stores/api";
|
||||
|
||||
const router = useRouter();
|
||||
const { notification } = defineProps({ notification: Object });
|
||||
const { formatDate, read } = useNotificationsStore();
|
||||
const { formatDate } = useNotificationsStore();
|
||||
const userStore = useUserStore();
|
||||
const api = useApiStore();
|
||||
|
||||
function readNotification() {
|
||||
api.readNotification(notification.id, notification.project.uri);
|
||||
userStore.readNotification(notification.id, notification.project.slug);
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
}}</strong
|
||||
>
|
||||
<span class="notification__client | text-grey-700">{{
|
||||
notification.location.project.title
|
||||
notification.project.title
|
||||
}}</span>
|
||||
<time
|
||||
datetime=""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue