mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-25 01:48:39 -06:00
fix: fix webhook integration
This commit is contained in:
parent
3b39f13180
commit
68f57aa507
@ -30,18 +30,16 @@ export class WebhookController extends EventController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
await this.get(instanceName);
|
await this.get(instanceName);
|
||||||
|
|
||||||
return this.prisma.webhook.update({
|
return this.prisma.webhook.upsert({
|
||||||
where: {
|
where: {
|
||||||
instanceId: this.monitor.waInstances[instanceName].instanceId,
|
instanceId: this.monitor.waInstances[instanceName].instanceId,
|
||||||
},
|
},
|
||||||
data,
|
update: {
|
||||||
});
|
...data,
|
||||||
} catch (err) {
|
},
|
||||||
return this.prisma.webhook.create({
|
create: {
|
||||||
data: {
|
|
||||||
enabled: data.enabled,
|
enabled: data.enabled,
|
||||||
events: data.events,
|
events: data.events,
|
||||||
instanceId: this.monitor.waInstances[instanceName].instanceId,
|
instanceId: this.monitor.waInstances[instanceName].instanceId,
|
||||||
@ -51,7 +49,6 @@ export class WebhookController extends EventController {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public async get(instanceName: string): Promise<wa.LocalWebHook> {
|
public async get(instanceName: string): Promise<wa.LocalWebHook> {
|
||||||
if (undefined === this.monitor.waInstances[instanceName]) {
|
if (undefined === this.monitor.waInstances[instanceName]) {
|
||||||
|
Loading…
Reference in New Issue
Block a user