fix: send contact.upsert via webhook

This commit is contained in:
Davidson Gomes
2024-04-12 12:33:31 -03:00
parent 4ca1fad335
commit d5d8f2a318
2 changed files with 6 additions and 3 deletions

View File

@@ -829,7 +829,7 @@ export class BaileysStartupService extends WAStartupService {
}
this.logger.verbose('Sending data to webhook in event CONTACTS_UPSERT');
this.sendDataWebhook(Events.CONTACTS_UPSERT, contactsRaw);
if (contactsRaw.length > 0) this.sendDataWebhook(Events.CONTACTS_UPSERT, contactsRaw);
this.logger.verbose('Inserting contacts in database');
this.repository.contact.insert(contactsRaw, this.instance.name, database.SAVE_DATA.CONTACTS);
@@ -851,7 +851,7 @@ export class BaileysStartupService extends WAStartupService {
}
this.logger.verbose('Sending data to webhook in event CONTACTS_UPDATE');
this.sendDataWebhook(Events.CONTACTS_UPSERT, contactsRaw);
if (contactsRaw.length > 0) this.sendDataWebhook(Events.CONTACTS_UPSERT, contactsRaw);
this.logger.verbose('Updating contacts in database');
this.repository.contact.update(contactsRaw, this.instance.name, database.SAVE_DATA.CONTACTS);