read notification working
This commit is contained in:
parent
0b472988a2
commit
2071d9bd6d
4 changed files with 57 additions and 48 deletions
|
|
@ -86,6 +86,7 @@ import { useDialogStore } from "../../stores/dialog";
|
|||
import { computed, onMounted, ref, useTemplateRef } from "vue";
|
||||
import { storeToRefs } from "pinia";
|
||||
import { usePageStore } from "../../stores/page";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
dayjs.locale("fr");
|
||||
|
||||
|
|
@ -96,6 +97,7 @@ const { comment, commentIndex } = defineProps({
|
|||
|
||||
const emits = defineEmits(["update:file", "close:comment"]);
|
||||
|
||||
const route = useRoute();
|
||||
const userStore = useUserStore();
|
||||
const api = useApiStore();
|
||||
const dialog = useDialogStore();
|
||||
|
|
@ -146,8 +148,7 @@ async function read() {
|
|||
if (getStatus.value !== "unread") return;
|
||||
try {
|
||||
const newNotification = await api.readNotification(comment, page.value.uri);
|
||||
console.log(newNotification);
|
||||
userStore.readNotification(comment.id);
|
||||
userStore.readNotification(comment.id, route.params.id);
|
||||
} catch (error) {
|
||||
console.log("Erreur lors de la lecture de la notification : ", error);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue