Skip to content

Commit 4ed0025

Browse files
committed
fix: empty search results and constant loading
1 parent 1f40ff7 commit 4ed0025

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pages/search.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export default function SearchResults() {
6060
},
6161
);
6262
const resFunctions = await fetch(
63-
`${API_URL}/search_functions?q=${searchTerm}&page=${pageNumber}&latest=1`,
63+
`${API_URL}/search_functions?q=${searchTerm}&package=${searchTerm}&page=${pageNumber}&latest=1`,
6464
{
6565
headers: {
6666
Accept: 'application/json',
@@ -73,6 +73,7 @@ export default function SearchResults() {
7373
setFunctionResults(functions);
7474
setIsLoading(false);
7575
} catch (error) {
76+
setIsLoading(false);
7677
console.log(error);
7778
}
7879
}

0 commit comments

Comments
 (0)