refactor: event folder

This commit is contained in:
Davidson Gomes
2024-08-20 15:36:55 -03:00
parent 7b79591e42
commit df77aadd04
6 changed files with 39 additions and 36 deletions

View File

@@ -98,7 +98,7 @@ export class WebsocketController extends EventController {
});
if (!data) {
throw new NotFoundException('Websocket not found');
return null;
}
return data;
@@ -153,11 +153,11 @@ export class WebsocketController extends EventController {
try {
const instanceSocket = await this.get(instanceName);
if (!instanceSocket.enabled) {
if (!instanceSocket?.enabled) {
return;
}
if (Array.isArray(instanceSocket.events) && instanceSocket.events.includes(configEv)) {
if (Array.isArray(instanceSocket?.events) && instanceSocket?.events.includes(configEv)) {
this.socket.of(`/${instanceName}`).emit(event, message);
if (logEnabled) {