Thanks for reply. and Sure, This is backend.
export async function overwriteContactInfo ( contactId , updatedContactInfo , options ) {
// Get the contact’s last revision number
const myContact = await contacts . getContact ( contactId );
const contactIdentifiers = {
contactId : contactId ,
revision : myContact.revision
};
return await contacts . updateContact ( contactIdentifiers , updatedContactInfo , options );
}
and this is front
$w ( “#button2” ). onClick (() => {
$w . onReady ( async function () {
**let** UID = $w ( '#input4' ). value ;
//current member's contactId
**function** getcontact ( options ) {
**return** currentMember . getMember ( options )
. then ( member => { **return** Promise . resolve ( member.contactId );})
. **catch** ( err => console . log ( err ));
}
**const** contactId = '' + **await** getcontact ();
**const** contactInfo = {
extendedFields : {
"custom.uid" : UID
}
};
**const** options = {
allowDuplicates : **false** ,
suppressAuth : **true**
};
overwriteContactInfo ( contactId , contactInfo , options );
})
});
});
is there anything wrong this code?