read notification on click working

This commit is contained in:
isUnknown 2024-12-16 18:14:14 +01:00
parent b1e8848fcd
commit f99e33f80e
5 changed files with 55 additions and 31 deletions

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