mirror of
https://github.com/xfarrow/blink
synced 2025-02-14 07:50:34 +01:00
Update register.html
This commit is contained in:
parent
b5d3cf1536
commit
9a79356778
@ -33,15 +33,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<script src="../js/constants.js"></script>
|
||||||
|
<script src="../js/utils.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
function register(){
|
function register(){
|
||||||
const display_name = document.getElementById("displayname").value;
|
const display_name = document.getElementById('displayname').value;
|
||||||
const email = document.getElementById("email").value;
|
const email = document.getElementById('email').value;
|
||||||
const password = document.getElementById("password").value;
|
const password = document.getElementById('password').value;
|
||||||
|
|
||||||
if(!display_name || !email || !password){
|
if(!display_name || !email || !password){
|
||||||
return;
|
alert('Please fill in all fields');
|
||||||
}
|
}
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
@ -52,7 +55,7 @@
|
|||||||
body: JSON.stringify({ display_name, email, password }),
|
body: JSON.stringify({ display_name, email, password }),
|
||||||
};
|
};
|
||||||
|
|
||||||
fetch('http://localhost:3000/blinkapi/register', options)
|
fetch(`${API_URL}/register`, options)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
alert("Congratulations! You've successfully registered to Blink." +
|
alert("Congratulations! You've successfully registered to Blink." +
|
||||||
|
Loading…
x
Reference in New Issue
Block a user