add / readNotification working
This commit is contained in:
parent
722c6b198e
commit
ed73b33234
6 changed files with 159 additions and 20 deletions
|
|
@ -27,6 +27,7 @@ return [
|
|||
require(__DIR__ . '/routes/remove-file.php'),
|
||||
require(__DIR__ . '/routes/upload-pdf.php'),
|
||||
require(__DIR__ . '/routes/add-comment.php'),
|
||||
require(__DIR__ . '/routes/read-notification.php'),
|
||||
],
|
||||
'hooks' => [
|
||||
'page.create:after' => require_once(__DIR__ . '/hooks/create-steps.php'),
|
||||
|
|
|
|||
15
public/site/config/routes/read-notification.php
Normal file
15
public/site/config/routes/read-notification.php
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'pattern' => '(:all)read-notification.json',
|
||||
'method' => 'POST',
|
||||
'action' => function () {
|
||||
$json = file_get_contents('php://input');
|
||||
$data = json_decode($json);
|
||||
$user = kirby()->user($data->userUuid);
|
||||
|
||||
$newNotifications = $user->readNotification($data->group, $data->notificationId);
|
||||
|
||||
return $newNotifications;
|
||||
}
|
||||
];
|
||||
Loading…
Add table
Add a link
Reference in a new issue