aboutsummaryrefslogtreecommitdiff
path: root/app/templates/signup.html
diff options
context:
space:
mode:
authorParker <contact@pkrm.dev>2024-11-06 01:08:04 -0600
committerParker <contact@pkrm.dev>2024-11-06 01:08:04 -0600
commit4c1dd74db3f9ac37134db13c8e5a499a9f37594a (patch)
tree5f9b72c25b66586e22d18ec5fd55e262e6eb3e2c /app/templates/signup.html
parenteadc9289338e8537c1ee70274007eea2dc395bde (diff)
Lots more functionality - working towards UI
Diffstat (limited to 'app/templates/signup.html')
-rw-r--r--app/templates/signup.html13
1 files changed, 7 insertions, 6 deletions
diff --git a/app/templates/signup.html b/app/templates/signup.html
index 446aaeb..32962b7 100644
--- a/app/templates/signup.html
+++ b/app/templates/signup.html
@@ -91,21 +91,22 @@
// Prevent default form submission
event.preventDefault();
+ // Get form data
const formData = new FormData(this);
- // Send POST request to /signup containing form data
+
+ // Send POST request
const response = await fetch('/api/users/register', {
method: 'POST',
body: formData
});
if (response.status != 200) {
- const data = await response.json();
-
+ const data = await response.json()
+
document.getElementById('error').style.display = 'block';
document.getElementById('error').innerText = data.detail;
- }
- else {
- window.location.href = '/login';
+ } else {
+ window.location.href = '/dashboard';
}
});
</script> \ No newline at end of file