diff options
| author | winter | 2025-03-21 21:29:53 +0000 |
|---|---|---|
| committer | winter | 2025-03-21 21:29:53 +0000 |
| commit | 9a6a54e2d6a6f7bff8ca5467c8a2680f4ad735fb (patch) | |
| tree | e3ad375ec978eadfef4df1719cd89877128109db /routes | |
| parent | 5e8fa866d9c390e8f364ae9de8cd94bb5a832751 (diff) | |
add timestamps to notifications
Diffstat (limited to 'routes')
| -rw-r--r-- | routes/notifications.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/routes/notifications.php b/routes/notifications.php index 11a73fb..a8949e4 100644 --- a/routes/notifications.php +++ b/routes/notifications.php @@ -13,8 +13,8 @@ Router::getInstance()->mount('/notifications/partial', function (array $args) { $when = new \DateTimeImmutable($_GET['since']); $notifs = Notification::findAllForUser($user, since: $when); - foreach ($notifs as $notif) { - $notif = $notif->toNotifyable(); + foreach ($notifs as $notification) { + $notif = $notification->toNotifyable(); if ($notif == null) continue; render_template('notification', [ @@ -23,6 +23,7 @@ Router::getInstance()->mount('/notifications/partial', function (array $args) { 'imageUrl' => $notif->getNotificationImageUrl(), 'titleLink' => $notif->getNotificationTitleLink(), 'imageLink' => $notif->getNotificationImageLink(), + 'timestamp' => $notification->created, 'unread' => true ]); } |
