add / readNotification working

This commit is contained in:
isUnknown 2024-10-28 17:50:40 +01:00
parent 722c6b198e
commit ed73b33234
6 changed files with 159 additions and 20 deletions

View 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;
}
];