Skip to content

Commit b0b316a

Browse files
authored
Merge pull request #123 from datacamp/bb/fix-search-returns-empty-results
[CT-3781] fix: empty search results and constant loading
2 parents f2fc76c + 4ed0025 commit b0b316a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pages/search.tsx

+2-1
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)