fix: use server-side time_ago for notification timestamps

This commit is contained in:
2026-06-13 16:56:43 -04:00
parent edd9933430
commit 045f33bbc1
2 changed files with 7 additions and 14 deletions

View File

@@ -699,9 +699,14 @@ class ApiController
$result = $notificationModel->getForUser((int) $user['id'], $page, $perPage);
$unreadCount = $notificationModel->getUnreadCount((int) $user['id']);
$data = array_map(function ($n) {
$n['time_ago'] = time_ago($n['created_at'] ?? '');
return $n;
}, $result['data']);
$this->view->json([
'success' => true,
'data' => $result['data'],
'data' => $data,
'pagination' => [
'page' => $result['page'],
'per_page' => $result['per_page'],