comments / notifications : improve abstraction
This commit is contained in:
parent
f467012241
commit
32c026acfe
11 changed files with 92 additions and 65 deletions
|
|
@ -7,8 +7,9 @@ return [
|
|||
$json = file_get_contents('php://input');
|
||||
$data = json_decode($json);
|
||||
|
||||
$page = page($data->page->uri);
|
||||
$file = $page->file($data->file->uuid);
|
||||
$page = page($data->location->page->uri);
|
||||
$project = page($data->location->project->uri);
|
||||
$file = $page->file($data->location->file->uuid);
|
||||
$isReply = $data->parentId ?? false;
|
||||
|
||||
$comments = $file->comments()->isEmpty() == true ? [] : Yaml::decode($file->comments()->value());
|
||||
|
|
@ -38,7 +39,7 @@ return [
|
|||
|
||||
echo json_encode(getFileData($newFile));
|
||||
|
||||
kirby()->user()->deleteNotification($page->managers()->toUsers(), $data->id);
|
||||
kirby()->user()->deleteNotification($project->managers()->toUsers(), $data->id);
|
||||
|
||||
exit;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue