From 4ed002571607ccfa2dbee80f456b6a4ca4119955 Mon Sep 17 00:00:00 2001 From: ben-brooker Date: Fri, 8 Jul 2022 11:54:31 +0100 Subject: [PATCH] fix: empty search results and constant loading --- pages/search.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pages/search.tsx b/pages/search.tsx index d41a047..8b8056a 100644 --- a/pages/search.tsx +++ b/pages/search.tsx @@ -60,7 +60,7 @@ export default function SearchResults() { }, ); const resFunctions = await fetch( - `${API_URL}/search_functions?q=${searchTerm}&page=${pageNumber}&latest=1`, + `${API_URL}/search_functions?q=${searchTerm}&package=${searchTerm}&page=${pageNumber}&latest=1`, { headers: { Accept: 'application/json', @@ -73,6 +73,7 @@ export default function SearchResults() { setFunctionResults(functions); setIsLoading(false); } catch (error) { + setIsLoading(false); console.log(error); } }