Custom User Registration (Submit Not Working)

Hi All - Someone wrote the code below for us, and then vanished.

When I click on the submit button, it does nothing, but I see “Submitted Successfully” (#text131) and “an Error Has Occurred” (#text130) text boxes when editing, but neither come up on the published site. Does anyone have an idea of what code is missing to get this to work? I am assuming that it needs to check if the user is already registered, and then redirect to another page. Thanks so much (if anyone will actually read this, haha)

import wixUsers from 'wix-users';
import wixLocation from 'wix-location';
import wixWindow from 'wix-window';
import wixData from 'wix-data';

$w.onReady(function () {
 
});

export function button3_click(event) {
 let fname = $w("#input2").value;
 let lname = $w("#input6").value;
 let email = $w("#input4").value;
 let password = $w("#input5").value;

 let toInsert = {
 "name": fname,
 "email": email,
 "region": $w("#dropdown1").value,
 "roles": $w("#dropdown3").value,
 "group": $w("#dropdown2").value
    }

if (($w("#input2").valid) && ($w("#input6").valid) && ($w("#dropdown1").value !== '') && ($w("#dropdown2").value !== '') && (($w("#dropdown3").value !== '')))  {
 
wixUsers.register(email, password, {
 "contactInfo": {
 "firstName": fname,
 "lastName": lname,
           }
})
.then(async(results)=>

{

await wixData.insert('endo-items', toInsert);

$w("#text130").collapse();
$w("#text131").expand();

wixLocation.to("/Home")
}
)
.catch( (err) =>{
console.log(err);
$w("#text130").text = "Please Enter your email or password correctly";
$w("#text130").expand();
    }
    );
}

else if (fname.length < 1)
{
$w("#text130").text = "Please Enter your first name";
$w("#text130").expand();
}

else if (lname.length < 1)
{
$w("#text130").text = "Please Enter your last name";
$w("#text130").expand();
}

else if ($w("#dropdown1").value === '')
{
$w("#text130").text = "Please Enter your region";
$w("#text130").expand();
}

else if ($w("#dropdown2").value === '')
{
$w("#text130").text = "Please Enter your group";
$w("#text130").expand();
}

else if ($w("#dropdown3").value === '')
{
$w("#text130").text = "Please Enter your role";
$w("#text130").expand();
}

}