wix-users & wix-crm relationship bug/feature request

Now that it is possible to access Wix-CRM records directly using getContactById it should be possible to use Wix-users.register with the resulting contact record and NOT create a duplicate CRM record.

Sequence of events:

import wixCrm from ‘wix-crm-backend’;
import wixUsers from ‘wix-users-backend’;

export async function createUserFromCRM (firstName, lastName, email) {
let contactId = await wixCrm.create ontact({firstName,lastName,emails[email]});
let contactInfo = await wixCrm.getContactById(contactId);
contactInfo._id = contactInfo._id || contactInfo.id; // force ID
let newUser = await wixUsers.register(email, “password”, {contactInfo}); // Should create a new user for an existing contact BUT creates a duplicate contact record instead.
return newUser;

}

This code will create two contact records instead of reusing the first.

I think this is a bug :slight_smile:

1 Like