Update register.html

This commit is contained in:
xfarrow 2024-03-04 09:09:11 +01:00
parent b5d3cf1536
commit 9a79356778

View File

@ -33,15 +33,18 @@
</div>
</div>
<script src="../js/constants.js"></script>
<script src="../js/utils.js"></script>
<script>
function register(){
const display_name = document.getElementById("displayname").value;
const email = document.getElementById("email").value;
const password = document.getElementById("password").value;
const display_name = document.getElementById('displayname').value;
const email = document.getElementById('email').value;
const password = document.getElementById('password').value;
if(!display_name || !email || !password){
return;
alert('Please fill in all fields');
}
const options = {
@ -52,7 +55,7 @@
body: JSON.stringify({ display_name, email, password }),
};
fetch('http://localhost:3000/blinkapi/register', options)
fetch(`${API_URL}/register`, options)
.then(response => {
if (response.ok) {
alert("Congratulations! You've successfully registered to Blink." +