send comment notification working

This commit is contained in:
isUnknown 2024-10-28 16:52:59 +01:00
parent 85537d3465
commit 722c6b198e
2 changed files with 13 additions and 6 deletions

View file

@ -13,10 +13,17 @@ Template: document
Comments:
1:
m2t543hr:
m2t7307h:
fileUuid: file://s0lNtRA0Z7ybTCWG
page: 1
text: Un autre commentaire
text: Un commentaire
username: Adrien Payet
date: 2024-10-28T15:54:43+01:00
id: m2t543hr
date: 2024-10-28T16:49:51+01:00
id: m2t7307h
m2t76m4t:
fileUuid: file://s0lNtRA0Z7ybTCWG
page: 1
text: Autre commentaire
username: Utilisateur Dior
date: 2024-10-28T16:52:39+01:00
id: m2t76m4t

View file

@ -12,10 +12,10 @@ return [
$user = kirby()->user($data->userUuid);
$comments = $file->comments()->isEmpty() == true ? [] : [];
$comments = $file->comments()->isEmpty() == true ? [] : Yaml::decode($file->comments()->value());
$newComment = [
'fileUuid' => (string )$file->uuid(),
'fileUuid' => (string) $file->uuid(),
'page' => $data->targetPage,
'text' => $data->text,
'username' => $user->name()->isNotEmpty() ? (string) $user->name() : (string) $user->email(),