mirror of
https://gitea.smigz.com/smiggiddy/odin-codeprojects.git
synced 2025-04-18 15:31:17 -04:00
14 lines
438 B
JavaScript
14 lines
438 B
JavaScript
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');
|
|
});
|