forked from syntaxbullet/AuroraBot-discord
refactor: improve type safety and remove forced casts in dashboard service
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user