mirror of
https://github.com/hexastack/hexabot
synced 2025-02-23 04:48:51 +00:00
fix: update chat.service onSubscriberCreate, onSubscriberUpdate methods
This commit is contained in:
parent
227630d6c6
commit
7f6b481988
@ -296,7 +296,9 @@ export class ChatService {
|
||||
@OnEvent('hook:subscriber:postCreate')
|
||||
async onSubscriberCreate({ _id }: SubscriberDocument) {
|
||||
const subscriber = await this.subscriberService.findOne(_id);
|
||||
if (subscriber) this.websocketGateway.broadcastSubscriberNew(subscriber);
|
||||
if (subscriber) {
|
||||
this.websocketGateway.broadcastSubscriberNew(subscriber);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -307,6 +309,8 @@ export class ChatService {
|
||||
@OnEvent('hook:subscriber:postUpdate')
|
||||
async onSubscriberUpdate({ _id }: SubscriberDocument) {
|
||||
const subscriber = await this.subscriberService.findOne(_id);
|
||||
if (subscriber) this.websocketGateway.broadcastSubscriberUpdate(subscriber);
|
||||
if (subscriber) {
|
||||
this.websocketGateway.broadcastSubscriberUpdate(subscriber);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user