[Ingest] Fix package info request returning 500 (#61712)

* Fix 500 package info request error

* Fix installed packages page not loading

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
Jen Huang 2020-04-02 13:04:32 -07:00 committed by GitHub
parent 4cb96ee74a
commit 2ae566ec78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 3 deletions

View file

@ -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);

View file

@ -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);