change notifications structure from object to array

This commit is contained in:
isUnknown 2024-10-30 12:15:28 +01:00
parent 0d25794b87
commit 20824983a6
8 changed files with 64 additions and 50 deletions

View file

@ -26,7 +26,7 @@ return [
],
'replies' => [],
'text' => $data->text,
'user' => $user,
'author' => $user,
'date' => (string) $data->date,
'id' => $data->id,
'type' => 'comment'
@ -34,13 +34,13 @@ return [
$newComment = new Comment($data);
$comments[$newComment->id()] = $newComment->toArray();
$comments[] = $newComment->toArray();
$newFile = $file->update([
'comments' => $comments
]);
$user->sendNotification('comments', $newComment);
$user->sendNotification($newComment);
return getFileData($newFile);
}