mirror of
https://gitea.smigz.com/smiggiddy/odin-codeprojects.git
synced 2025-06-28 04:45:36 -04:00
done
This commit is contained in:
parent
e89fb616e7
commit
b1c295d2ac
12 changed files with 2783 additions and 55 deletions
14
file-uploader/public/js/form.js
Normal file
14
file-uploader/public/js/form.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
console.log('form stuff');
|
||||
|
||||
const usernameCheck = async (username) => {
|
||||
let res = await fetch(`/auth/username?username=${username}`);
|
||||
return await res.json();
|
||||
};
|
||||
|
||||
const input = document.querySelector("input[name='username']");
|
||||
|
||||
input.addEventListener('input', async (e) => {
|
||||
let input = e.target.value;
|
||||
let test = await usernameCheck(input);
|
||||
test.results ? console.log('user exists') : console.log('user doesnt');
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue