mirror of
https://github.com/Floriansylvain/projet_programmation_web.git
synced 2026-08-19 11:43:16 +02:00
🐛 Fixed error when search too short
This commit is contained in:
@@ -72,7 +72,13 @@ function apiRequestThese(search, offset) {
|
||||
.then(data => {
|
||||
fetch(`api.php?q=count&search=${searchString}&option=${queryOption}&offset=0`)
|
||||
.then(response => response.json())
|
||||
.then(aCount => displayResults(data, aCount.data[0]))
|
||||
.then(aCount => {
|
||||
if (aCount.data) {
|
||||
displayResults(data, aCount.data[0])
|
||||
} else {
|
||||
displayResults(data, 0)
|
||||
}
|
||||
})
|
||||
})
|
||||
} else {
|
||||
alert('Veuillez attendre une seconde entre chaque recherche.')
|
||||
|
||||
Reference in New Issue
Block a user