designtopack/public/site/plugins/notifications/routes/mark-as-read.php

15 lines
365 B
PHP
Raw Normal View History

2024-10-28 17:50:40 +01:00
<?php
return [
'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;
}
];