dynamize notifications view

This commit is contained in:
isUnknown 2024-10-29 17:26:23 +01:00
parent 8ed7331b61
commit c099e0d5ac
6 changed files with 127 additions and 132 deletions

View file

@ -15,9 +15,14 @@ return [
$comments = $file->comments()->isEmpty() == true ? [] : Yaml::decode($file->comments()->value());
$newComment = [
'pageUri' => $data->pageUri,
'fileUuid' => (string) $file->uuid(),
'filePageIndex' => $data->filePageIndex,
'page' => [
'uri' => (string) $page->parent()->uri(),
'title' => (string) $page->parent()->title(),
],
'file' => [
'uuid' => (string) $file->uuid(),
'pageIndex' => $data->filePageIndex,
],
'position' => [
'x' => null,
'y' => null
@ -32,6 +37,7 @@ return [
],
'date' => (string) $data->date,
'id' => $data->id,
'type' => 'comment'
];
$comments[$data->id] = $newComment;
@ -40,7 +46,7 @@ return [
'comments' => $comments
]);
// $user->sendNotification('comments', $newComment);
$user->sendNotification('comments', $newComment);
return getFileData($newFile);
}