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