import wixData from 'wix-data';// at the top of the code
//...your code.....
export function submit_click_1(event) {
let email = $w("#email").value;
let password = $w("#password").value;
Promise.all([
wixData.query("COLLECTION NAME")
eq("email", email)
.distinct("team"),
wixUsers.login(email, password)
])
.then(r => {
let retrievedTeams = r[0].items;
let team = retrievedTeams[0];
wixLocation.to("/form/" + team);
})
})
//...the rest of the code