2024-10-28 17:50:40 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
return [
|
2024-10-29 11:35:48 +01:00
|
|
|
'pattern' => '(:all)mark-as-read.json',
|
2024-10-28 17:50:40 +01:00
|
|
|
'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;
|
|
|
|
|
}
|
|
|
|
|
];
|