Escutar a configuração do webhook para midias recebidas

This commit is contained in:
Felipe Medeiros
2024-10-07 19:14:21 -03:00
parent f5f778ecbe
commit 7adab5c1c0
2 changed files with 39 additions and 22 deletions

View File

@@ -34,6 +34,7 @@ export class ChannelStartupService {
public readonly localChatwoot: wa.LocalChatwoot = {};
public readonly localProxy: wa.LocalProxy = {};
public readonly localSettings: wa.LocalSettings = {};
public readonly localWebhook: wa.LocalWebHook = {};
public chatwootService = new ChatwootService(
waMonitor,
@@ -124,6 +125,17 @@ export class ChannelStartupService {
return this.instance.wuid;
}
public async loadWebhook() {
const data = await this.prismaRepository.webhook.findUnique({
where: {
instanceId: this.instanceId,
},
});
this.localWebhook.enabled = data?.enabled;
this.localWebhook.webhookBase64 = data?.webhookBase64;
}
public async loadSettings() {
const data = await this.prismaRepository.setting.findUnique({
where: {