mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-24 17:38:40 -06:00
Correction for global webhook
This commit is contained in:
parent
1665654676
commit
872aa2a418
@ -66,10 +66,8 @@ export class WebhookController extends EventController implements EventControlle
|
||||
local,
|
||||
}: EmitData): Promise<void> {
|
||||
const instance = (await this.get(instanceName)) as wa.LocalWebHook;
|
||||
|
||||
if (!instance || !instance?.enabled) {
|
||||
return;
|
||||
}
|
||||
console.log(instanceName)
|
||||
|
||||
|
||||
const webhookConfig = configService.get<Webhook>('WEBHOOK');
|
||||
const webhookLocal = instance?.events;
|
||||
@ -82,14 +80,14 @@ export class WebhookController extends EventController implements EventControlle
|
||||
event,
|
||||
instance: instanceName,
|
||||
data,
|
||||
destination: instance?.url,
|
||||
destination: instance?.url || `${webhookConfig.GLOBAL.URL}/${transformedWe}`,
|
||||
date_time: dateTime,
|
||||
sender,
|
||||
server_url: serverUrl,
|
||||
apikey: apiKey,
|
||||
};
|
||||
|
||||
if (local) {
|
||||
if (local && !instance || !instance?.enabled) {
|
||||
if (Array.isArray(webhookLocal) && webhookLocal.includes(we)) {
|
||||
let baseURL: string;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user