async function onSubmit() {
formSubmited.value = true;
loading.value = true;
const token = useCookie<string>("X-auth").value;
const {data, error} = await useFetch<{message: string}>(api_url+"users",{
headers: {
"X-auth" : token
},
method: "POST",
body: JSON.stringify({
user: {
email : user_email.value,
username : user_username.value,
password : user_password.value
},
club: {
name : club_name.value,
legal_nature : club_legal_nature.value,
sol_adm : club_sol_adm.value,
polysport : club_polysport.value,
tax_code : club_tax_code.value,
tva: club_tva.value,
sports_group : club_sports_group.value,
com_prov : club_com_prov.value,
group : club_group.value,
affiliation_code : club_affiliation_code.value,
address : club_address.value,
email : club_email.value,
telephone : club_telephone.value,
pec : club_pec.value,
login_email : club_login_email.value,
login_password : club_login_password.value
}
})
});
await navigateTo("/dashboard");
await refreshNuxtData("clubs");
}