mirror of
https://github.com/Floriansylvain/projet_programmation_web.git
synced 2026-10-18 20:44:11 +02:00
🐛 Fixed error when search too short
This commit is contained in:
1 parent
8d79696ce0
commit
a2d42aaa61
1 file changed
+7
-1
@@ -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