#404 #failure #customRegistration #wixUsers
Hi guys,
I'm trying to setup a custom registration form and I end up getting an unknown failure (404) error whenever I submit the form (Both Preview and Live Modes)
This is the Dev panel:
This is my code:
function createMember() {
let label = "Seller";
wixUsers.register($w("#email").value, $w("#password").value, {
"contactInfo": {
"firstName": $w("#firstName").value,
"lastName": $w("#lastName").value,
"agencyName": $w("#agency").value,
"labels": label
}
} )
.then( (result) => {
let status = result.status;
reDirect(status);
} )
.catch( (err) => {
console.log(err);
$w("#signUpError").show();
} );
}
This is my Custom Field:
These are my labels:
Am I doing something wrong or is this a bug?
-Shan
@shan
Create a new field name in the the CRM and call it "agencyName2"
then...
"agencyName2": $w("#agency").value
Hi Shan,
I believe I discovered the issue in your code regarding the label not being added. When you add labels via the wixUsers.register() API, it requires that you add them as an array. This allows you to add multiple labels, but even if you're only adding one, it still needs to be in an array.
So your variable assignment should be:
let label = ["Seller"];
When I tried it using your code, I received a 400 error. Once I converted it to an array, it worked fine.
I admit it should handle this more gracefully, particularly because the error is not very specific. I'll speak to the developers about this.
Anyway, please give this a try and let us know if that fixes the problem. Good luck!
anyone?