23 lines
No EOL
583 B
PHP
23 lines
No EOL
583 B
PHP
<?php
|
|
|
|
return [
|
|
'pattern' => '(:all)read-all-notifications.json',
|
|
'method' => 'GET',
|
|
'action' => function () {
|
|
$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()
|
|
]);
|
|
}
|
|
}
|
|
}
|
|
]; |