Skip to content

Commit

Permalink
[Ingest] Fix package info request returning 500 (#61712)
Browse files Browse the repository at this point in the history
* Fix 500 package info request error

* Fix installed packages page not loading

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
jen-huang and elasticmachine authored Apr 2, 2020
1 parent 4cb96ee commit 2ae566e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const usePackageIcon = (packageName: string, version?: string, icons?: Package['
}

// Use API to see if package has icons defined
if (!icons && version !== undefined) {
if (!icons && version) {
fromPackageInfo(pkgKey)
.catch(() => undefined) // ignore API errors
.then(fromInput);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ export function useLocalSearch(packageList: PackageList) {
const localSearchRef = useRef<LocalSearch | null>(null);

useEffect(() => {
if (!packageList.length) return;

const localSearch = new LocalSearch(searchIdField);
fieldsToSearch.forEach(field => localSearch.addIndex(field));
localSearch.addDocuments(packageList);
Expand Down

0 comments on commit 2ae566e

Please sign in to comment.