mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-19 20:02:20 -06:00
Simplify events structure and fix minor issues
This commit is contained in:
@@ -2,7 +2,7 @@ import { InstanceDto, SetPresenceDto } from '@api/dto/instance.dto';
|
||||
import { ChatwootService } from '@api/integrations/chatbot/chatwoot/services/chatwoot.service';
|
||||
import { ProviderFiles } from '@api/provider/sessions';
|
||||
import { PrismaRepository } from '@api/repository/repository.service';
|
||||
import { channelController, eventController } from '@api/server.module';
|
||||
import { channelController, eventManager } from '@api/server.module';
|
||||
import { CacheService } from '@api/services/cache.service';
|
||||
import { WAMonitoringService } from '@api/services/monitor.service';
|
||||
import { SettingsService } from '@api/services/settings.service';
|
||||
@@ -81,7 +81,7 @@ export class InstanceController {
|
||||
this.waMonitor.delInstanceTime(instance.instanceName);
|
||||
|
||||
// set events
|
||||
await eventController.setInstance(instance.instanceName, instanceData);
|
||||
await eventManager.setInstance(instance.instanceName, instanceData);
|
||||
|
||||
instance.sendDataWebhook(Events.INSTANCE_CREATE, {
|
||||
instanceName: instanceData.instanceName,
|
||||
@@ -154,22 +154,18 @@ export class InstanceController {
|
||||
},
|
||||
hash,
|
||||
webhook: {
|
||||
webhookUrl: instanceData.webhookUrl,
|
||||
webhookByEvents: instanceData.webhookByEvents,
|
||||
webhookBase64: instanceData.webhookBase64,
|
||||
// events: getWebhookEvents,
|
||||
webhookUrl: instanceData.webhook.url,
|
||||
webhookByEvents: instanceData.webhook.byEvents,
|
||||
webhookBase64: instanceData.webhook.base64,
|
||||
},
|
||||
websocket: {
|
||||
enabled: instanceData.websocketEnabled,
|
||||
// events: getWebsocketEvents,
|
||||
enabled: instanceData.websocket.enabled,
|
||||
},
|
||||
rabbitmq: {
|
||||
enabled: instanceData.rabbitmqEnabled,
|
||||
// events: getRabbitmqEvents,
|
||||
enabled: instanceData.rabbitmq.enabled,
|
||||
},
|
||||
sqs: {
|
||||
enabled: instanceData.sqsEnabled,
|
||||
// events: getSqsEvents,
|
||||
enabled: instanceData.sqs.enabled,
|
||||
},
|
||||
settings,
|
||||
qrcode: getQrcode,
|
||||
@@ -245,22 +241,18 @@ export class InstanceController {
|
||||
},
|
||||
hash,
|
||||
webhook: {
|
||||
webhookUrl: instanceData.webhookUrl,
|
||||
webhookByEvents: instanceData.webhookByEvents,
|
||||
webhookBase64: instanceData.webhookBase64,
|
||||
// events: getWebhookEvents,
|
||||
webhookUrl: instanceData.webhook.url,
|
||||
webhookByEvents: instanceData.webhook.byEvents,
|
||||
webhookBase64: instanceData.webhook.base64,
|
||||
},
|
||||
websocket: {
|
||||
enabled: instanceData.websocketEnabled,
|
||||
// events: getWebsocketEvents,
|
||||
enabled: instanceData.websocket.enabled,
|
||||
},
|
||||
rabbitmq: {
|
||||
enabled: instanceData.rabbitmqEnabled,
|
||||
// events: getRabbitmqEvents,
|
||||
enabled: instanceData.rabbitmq.enabled,
|
||||
},
|
||||
sqs: {
|
||||
enabled: instanceData.sqsEnabled,
|
||||
// events: getSqsEvents,
|
||||
enabled: instanceData.sqs.enabled,
|
||||
},
|
||||
settings,
|
||||
chatwoot: {
|
||||
|
||||
Reference in New Issue
Block a user