From 131a466b17cf61d59631515df217a2a52d27fb40 Mon Sep 17 00:00:00 2001 From: Florian Sylvain Date: Fri, 7 Jan 2022 18:10:40 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Condensed=20condition?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ProjetProgWeb/app.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/ProjetProgWeb/app.js b/ProjetProgWeb/app.js index 033f232..fc0c2a7 100644 --- a/ProjetProgWeb/app.js +++ b/ProjetProgWeb/app.js @@ -72,13 +72,7 @@ function apiRequestThese(search, offset) { .then(data => { fetch(`api.php?q=count&search=${searchString}&option=${queryOption}&offset=0`) .then(response => response.json()) - .then(aCount => { - if (aCount.data) { - displayResults(data, aCount.data[0]) - } else { - displayResults(data, 0) - } - }) + .then(aCount => displayResults(data, aCount.data ? aCount.data[0] : 0)) }) } else { alert('Veuillez attendre une seconde entre chaque recherche.')