read comment notification working
This commit is contained in:
parent
9222069ef5
commit
246d21f85a
17 changed files with 86 additions and 111 deletions
|
|
@ -6,8 +6,18 @@ return [
|
|||
'action' => function () {
|
||||
$json = file_get_contents('php://input');
|
||||
$data = json_decode($json);
|
||||
|
||||
$newNotifications = kirby()->user()->readNotification($data->notificationId);
|
||||
return $newNotifications;
|
||||
|
||||
try {
|
||||
$project = page($data->projectUuid);
|
||||
$project->readNotification($data->notificationId);
|
||||
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