Commit 8bb97b36 authored by Zohten's avatar Zohten

basic test

parent cc6060f3
......@@ -47,7 +47,7 @@ export default {
updateShowBackError: function(){
this.showBackError = false; //TODO
},
onSubmit: function(){
onSubmit: async function(){
this.showPwdError = (document.getElementById('password1').value !== document.getElementById('password2').value);
if (this.showPwdError) {
return;
......@@ -60,7 +60,26 @@ export default {
this.$router.push('/');
}
if (event.submitter.id=='validate') {
this.$router.push('lobby');
let request = await fetch('http://localhost/index.php/user',
{
method: 'POST',
headers: {
'Content-Type': 'application/json;charset=utf-8'
},
body: JSON.stringify({
login: "NEWUSER",
pwd: "hashedNEWUSERpwd",
avatar: "avatarnew.png",
lastname: "NEW",
firstname: "USER",
mail: "new.user@free.fr"
})
}); //creating the content and sending the request
let response = await request;
if (response.ok){
this.$router.push('lobby');
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment