comments working
This commit is contained in:
parent
375bed1d01
commit
0b472988a2
14 changed files with 107 additions and 59 deletions
|
|
@ -10,10 +10,8 @@ return [
|
|||
$data = json_decode($json);
|
||||
|
||||
$page = page($data->fileParentUri);
|
||||
$project = $page->parent()->template() == "project" ? $page->parent() : $page->parent()->parent();
|
||||
|
||||
$file = $page->file($data->fileName);
|
||||
$user = kirby()->user($data->userUuid);
|
||||
|
||||
$comments = $file->comments()->isEmpty() == true ? [] : Yaml::decode($file->comments()->value());
|
||||
|
||||
foreach ($comments as &$comment) {
|
||||
|
|
@ -22,8 +20,6 @@ return [
|
|||
$replyData = [
|
||||
"location" => [
|
||||
"page" => $page,
|
||||
"project" => $project,
|
||||
"dialogUri" => $data->dialogUri,
|
||||
"file" => $file,
|
||||
"parent" => $comment
|
||||
],
|
||||
|
|
@ -45,7 +41,8 @@ return [
|
|||
'comments' => $comments
|
||||
]);
|
||||
|
||||
$user->sendNotification($project, $replyData);
|
||||
$project = $page->parents()->findBy("template", "project");
|
||||
$project->createNotification($replyData);
|
||||
|
||||
return getFileData($newFile);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue