Skip to content

Commit

Permalink
Add search for user #11
Browse files Browse the repository at this point in the history
  • Loading branch information
Scobiform committed Apr 19, 2024
1 parent 571cd43 commit cead722
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,17 @@
// Check if the enter key is pressed
if (event.key === "Enter") {
submitForm();
}
else {
timeout = setTimeout(submitForm, delay);
} else {
timeout = setTimeout(() => {
const query = document.getElementById('searchUser').value;
fetch(`{{ app_url }}/search?query=${query}`)
.then(response => response.json())
.then(data => {
displayResults(data);
console.log(data);
})
.catch(error => console.error('Error:', error));
}, delay);
}

}
Expand Down

0 comments on commit cead722

Please sign in to comment.