read all working
This commit is contained in:
parent
495e1c024e
commit
ef09a04b5e
7 changed files with 105 additions and 65 deletions
|
|
@ -4,7 +4,20 @@ return [
|
|||
'pattern' => '(:all)read-all-notifications.json',
|
||||
'method' => 'GET',
|
||||
'action' => function () {
|
||||
$newNotifications = kirby()->user()->readAllNotifications();
|
||||
return $newNotifications;
|
||||
$projects = page("projects");
|
||||
|
||||
foreach ($projects->children() as $project) {
|
||||
try {
|
||||
$project->readAllNotifications();
|
||||
return json_encode([
|
||||
"status" => "success"
|
||||
]);
|
||||
} catch (\Throwable $th) {
|
||||
return json_encode([
|
||||
"status" => "error",
|
||||
"message" => $th->getMessage() . ' line ' . $th->getLine() . " in file " . $th->getFile()
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
];
|
||||
Loading…
Add table
Add a link
Reference in a new issue