read notification on click working
This commit is contained in:
parent
b1e8848fcd
commit
f99e33f80e
5 changed files with 55 additions and 31 deletions
13
public/site/plugins/notifications/routes/read.php
Normal file
13
public/site/plugins/notifications/routes/read.php
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'pattern' => '(:all)read-notification.json',
|
||||
'method' => 'POST',
|
||||
'action' => function () {
|
||||
$json = file_get_contents('php://input');
|
||||
$data = json_decode($json);
|
||||
|
||||
$newNotifications = kirby()->user()->readNotification($data->notificationId);
|
||||
return $newNotifications;
|
||||
}
|
||||
];
|
||||
Loading…
Add table
Add a link
Reference in a new issue