Skip to content

Commit

Permalink
Merge pull request #1088 from joaosantanadev/develop
Browse files Browse the repository at this point in the history
[FIX]Correction of webhook global
  • Loading branch information
DavidsonGomes authored Nov 27, 2024
2 parents 62ea22a + 370025b commit 682eaa9
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/api/integrations/event/webhook/webhook.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down

0 comments on commit 682eaa9

Please sign in to comment.