diff options
author | Parker <contact@pkrm.dev> | 2024-11-05 21:23:19 -0600 |
---|---|---|
committer | Parker <contact@pkrm.dev> | 2024-11-05 21:23:19 -0600 |
commit | ddb984d0cde0458d8e2db9e5230b15d052a703bf (patch) | |
tree | 07a1c393f2908468ef0e70d0002333ca6f211e07 /app/templates/signup.html | |
parent | e944df3d7d431b5bd88c2c235501a355ea1ba6ab (diff) |
Update + Signup works!
Diffstat (limited to 'app/templates/signup.html')
-rw-r--r-- | app/templates/signup.html | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/app/templates/signup.html b/app/templates/signup.html index a6d8fbf..446aaeb 100644 --- a/app/templates/signup.html +++ b/app/templates/signup.html @@ -91,24 +91,21 @@ // Prevent default form submission event.preventDefault(); - // Get form data const formData = new FormData(this); - - console.log(formData) - // Send POST request to /signup containing form data - const response = await fetch('/signup', { + const response = await fetch('/api/users/register', { method: 'POST', body: formData }); - data = await response.json() + if (response.status != 200) { + const data = await response.json(); - if (data.status != "success") { document.getElementById('error').style.display = 'block'; - document.getElementById('error').innerText = data.status; - } else { - window.location.href = '/dashboard'; + document.getElementById('error').innerText = data.detail; + } + else { + window.location.href = '/login'; } }); </script>
\ No newline at end of file |