Skip to content

Commit

Permalink
Merge pull request #123 from datacamp/bb/fix-search-returns-empty-res…
Browse files Browse the repository at this point in the history
…ults

[CT-3781] fix: empty search results and constant loading
  • Loading branch information
ben-brooker authored Jul 11, 2022
2 parents f2fc76c + 4ed0025 commit b0b316a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pages/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -73,6 +73,7 @@ export default function SearchResults() {
setFunctionResults(functions);
setIsLoading(false);
} catch (error) {
setIsLoading(false);
console.log(error);
}
}
Expand Down

0 comments on commit b0b316a

Please sign in to comment.