})
}
- sendNotification (userId: number, notification: UserNotificationModel) {
+ sendNotification (userId: number, notification: UserNotificationModelForApi) {
- const socket = this.userNotificationSockets[userId]
+ const sockets = this.userNotificationSockets[userId]
- if (!socket) return
+ if (!sockets) return
- socket.emit('new-notification', notification.toFormattedJSON())
+ for (const socket of sockets) {
+ socket.emit('new-notification', notification.toFormattedJSON())
+ }
}
static get Instance () {