diff --git a/public/site/config/routes/validate-brief.php b/public/site/config/routes/validate-brief.php index bfea8e2..f8e97f1 100644 --- a/public/site/config/routes/validate-brief.php +++ b/public/site/config/routes/validate-brief.php @@ -9,7 +9,6 @@ return [ $page = page($data->briefUri); $project = $page->parent(); - $dialogUri = $data->dialogUri ? $data->dialogUri : null; try { $newPage = $page->update([ @@ -22,8 +21,6 @@ return [ $notification = [ 'location' => [ 'page' => $page, - 'project' => $project, - 'dialogUri' => (string) $dialogUri, ], 'date' => $dateTime->format('Y-m-d\TH:i:sP'), 'text' => "Nouveau brief", @@ -32,7 +29,7 @@ return [ 'type' => 'content' ]; - kirby()->user()->sendNotification($project, $notification); + $project->createNotification($notification); return [ "success" => "'" . $project->title()->value() . "' brief validated." diff --git a/src/components/comments/Comment.vue b/src/components/comments/Comment.vue index 353aec3..68713fb 100644 --- a/src/components/comments/Comment.vue +++ b/src/components/comments/Comment.vue @@ -147,7 +147,10 @@ function handleClick() { async function read() { if (getStatus.value !== "unread") return; try { - const newNotification = await api.readNotification(comment, page.value.uri); + const newNotification = await api.readNotification( + comment.id, + page.value.uri + ); userStore.readNotification(comment.id, route.params.id); } catch (error) { console.log("Erreur lors de la lecture de la notification : ", error); diff --git a/src/components/notifications/Content.vue b/src/components/notifications/Content.vue index 0965e54..2be62e5 100644 --- a/src/components/notifications/Content.vue +++ b/src/components/notifications/Content.vue @@ -2,10 +2,7 @@
@@ -16,7 +13,7 @@ >Contenu {{ - notification.location.project.title + notification.project.title }}