mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-23 17:08:44 -06:00
fix: fix webhook integration
This commit is contained in:
parent
3b39f13180
commit
68f57aa507
@ -30,27 +30,24 @@ export class WebhookController extends EventController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
await this.get(instanceName);
|
||||||
await this.get(instanceName);
|
|
||||||
|
return this.prisma.webhook.upsert({
|
||||||
return this.prisma.webhook.update({
|
where: {
|
||||||
where: {
|
instanceId: this.monitor.waInstances[instanceName].instanceId,
|
||||||
instanceId: this.monitor.waInstances[instanceName].instanceId,
|
},
|
||||||
},
|
update: {
|
||||||
data,
|
...data,
|
||||||
});
|
},
|
||||||
} catch (err) {
|
create: {
|
||||||
return this.prisma.webhook.create({
|
enabled: data.enabled,
|
||||||
data: {
|
events: data.events,
|
||||||
enabled: data.enabled,
|
instanceId: this.monitor.waInstances[instanceName].instanceId,
|
||||||
events: data.events,
|
url: data.url,
|
||||||
instanceId: this.monitor.waInstances[instanceName].instanceId,
|
webhookBase64: data.webhookBase64,
|
||||||
url: data.url,
|
webhookByEvents: data.webhookByEvents,
|
||||||
webhookBase64: data.webhookBase64,
|
},
|
||||||
webhookByEvents: data.webhookByEvents,
|
});
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async get(instanceName: string): Promise<wa.LocalWebHook> {
|
public async get(instanceName: string): Promise<wa.LocalWebHook> {
|
||||||
|
Loading…
Reference in New Issue
Block a user