From 5d2d4bb0c6e2e5129244dc41dc8ba49ac949b836 Mon Sep 17 00:00:00 2001 From: syntaxbullet Date: Thu, 8 Jan 2026 21:31:40 +0100 Subject: [PATCH] refactor: improve type safety and remove forced casts in dashboard service --- shared/modules/dashboard/dashboard.service.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shared/modules/dashboard/dashboard.service.ts b/shared/modules/dashboard/dashboard.service.ts index 1601373..ede2374 100644 --- a/shared/modules/dashboard/dashboard.service.ts +++ b/shared/modules/dashboard/dashboard.service.ts @@ -141,7 +141,9 @@ export const dashboardService = { const { systemEvents, EVENTS } = await import("@shared/lib/events"); systemEvents.emit(EVENTS.DASHBOARD.NEW_EVENT, { ...fullEvent, - timestamp: (fullEvent.timestamp as Date).toISOString() + timestamp: (fullEvent.timestamp instanceof Date) + ? fullEvent.timestamp.toISOString() + : fullEvent.timestamp }); } catch (e) { console.error("Failed to emit system event:", e);