From bc376a72ee5f71cc9fe7acbfdab9d14d382f2d8d Mon Sep 17 00:00:00 2001 From: Sonny Date: Mon, 7 Oct 2024 02:48:32 +0200 Subject: [PATCH] fix: error on admin dashboard when user "last seen" is null --- app/controllers/admin_controller.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/controllers/admin_controller.ts b/app/controllers/admin_controller.ts index 060f382..0c4e3af 100644 --- a/app/controllers/admin_controller.ts +++ b/app/controllers/admin_controller.ts @@ -14,9 +14,10 @@ class UserWithRelationCountDto { fullname: this.user.name, avatarUrl: this.user.avatarUrl, isAdmin: this.user.isAdmin, - createdAt: this.user.createdAt, - updatedAt: this.user.updatedAt, - lastSeenAt: this.user.lastSeenAt, + createdAt: this.user.createdAt.toString(), + updatedAt: this.user.updatedAt.toString(), + lastSeenAt: + this.user.lastSeenAt?.toString() ?? this.user.updatedAt.toString(), linksCount: Number(this.user.$extras.totalLinks), collectionsCount: Number(this.user.$extras.totalCollections), });