refactor: improve type safety and remove forced casts in dashboard service

This commit is contained in:
syntaxbullet
2026-01-08 21:31:40 +01:00
parent 19206b5cc7
commit 5d2d4bb0c6

View File

@@ -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);