mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-22 20:12:02 -06:00
Merge pull request #1088 from joaosantanadev/develop
[FIX]Correction of webhook global
This commit is contained in:
commit
682eaa995f
@ -66,10 +66,7 @@ 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;
|
||||
}
|
||||
|
||||
|
||||
const webhookConfig = configService.get<Webhook>('WEBHOOK');
|
||||
const webhookLocal = instance?.events;
|
||||
@ -82,14 +79,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