So as J. D. says, use the code example to suit your own needs.
Examples
Update a user
import wixUsers from 'wix-users-backend';
export function updateUserInfo(userId, firstName, lastName, email, phone) {
wixCrm.updateUserInfo(userId, {
"firstName": firstName,
"lastName": lastName,
"emails": [email],
"phones": [phone]
} )
.then( () => {
// contact has been updated
} )
.catch( (err) => {
// there was an error updating the contact
} );
}
Only the properties passed in the ContactInfo object will be updated. All other properties will remain the same.
As you know you can only update the userInfo fields plus any custom fields.
Page Not Found - Velo API Reference - Wix.com
Now note that these custom fields that are in your Wix CRM Contacts List need to be added to your code as they are exactly in your Contacts List and not as the normal way that we code the rest of the fields needed.
Also remember that Wix Users is for Site Members whilst Wix CRM is for all your Contacts and not all of them will be members.
If you want to use Wix CRM, then you will need to use Wix CRM backend and the updateContact function.
wix-crm-backend - Velo API Reference - Wix.com
Examples
Update an existing contact
This example contains a backend function that updates a contact.
import wixCrm from 'wix-crm-backend';
export function myBackendFunction(contactId, firstName, lastName, email, phone) {
wixCrm.updateContact(contactId, {
"firstName": firstName,
"lastName": lastName,
"emails": [email],
"phones": [phone]
} )
.then( () => {
// contact has been updated
} )
.catch( (err) => {
// there was an error updating the contact
} );
}