Commit 8bb97b36 authored by Zohten's avatar Zohten

basic test

parent cc6060f3
...@@ -47,7 +47,7 @@ export default { ...@@ -47,7 +47,7 @@ export default {
updateShowBackError: function(){ updateShowBackError: function(){
this.showBackError = false; //TODO this.showBackError = false; //TODO
}, },
onSubmit: function(){ onSubmit: async function(){
this.showPwdError = (document.getElementById('password1').value !== document.getElementById('password2').value); this.showPwdError = (document.getElementById('password1').value !== document.getElementById('password2').value);
if (this.showPwdError) { if (this.showPwdError) {
return; return;
...@@ -60,10 +60,29 @@ export default { ...@@ -60,10 +60,29 @@ export default {
this.$router.push('/'); this.$router.push('/');
} }
if (event.submitter.id=='validate') { if (event.submitter.id=='validate') {
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'); this.$router.push('lobby');
} }
} }
} }
}
} }
</script> </script>
......
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