Fix method saveOrEditAddressbookContact (#3923)

* Fix method saveOrEditAddressbookContact

* Update saveOrEditAddressbookContact return void

* Update saveOrEditAddressbookContact return void
This commit is contained in:
BenyFilho 2025-11-04 16:30:25 -03:00 • committed by GitHub
commit 6876dd236b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

2
index.d.ts vendored
View file

@ -242,7 +242,7 @@ declare namespace WAWebJS {
syncHistory(chatId: string): Promise<boolean>
/** Save new contact to user's addressbook or edit the existing one */
saveOrEditAddressbookContact(phoneNumber: string, firstName: string, lastName: string, syncToAddressbook?: boolean): Promise<ChatId>
saveOrEditAddressbookContact(phoneNumber: string, firstName: string, lastName: string, syncToAddressbook?: boolean): Promise<void>
/**
* Add or edit a customer note

View file

@ -2317,13 +2317,15 @@ class Client extends EventEmitter {
* @param {string} firstName
* @param {string} lastName
* @param {boolean} [syncToAddressbook = false] If set to true, the contact will also be saved to the user's address book on their phone. False by default
* @returns {Promise<import('..').ChatId>} Object in a wid format
* @returns {Promise<void>}
*/
async saveOrEditAddressbookContact(phoneNumber, firstName, lastName, syncToAddressbook = false)
{
return await this.pupPage.evaluate(async (phoneNumber, firstName, lastName, syncToAddressbook) => {
return await window.Store.AddressbookContactUtils.saveContactAction(
phoneNumber,
phoneNumber,
null,
null,
firstName,
lastName,