Skip to content

Commit

Permalink
fixed type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
juliaElastic committed Sep 23, 2021
1 parent 53fda55 commit 8511eff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 5 additions & 3 deletions x-pack/plugins/fleet/server/services/epm/packages/cleanup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,17 @@ export async function removeOldAssets(options: {
const aggs = {
versions: { terms: { field: `${ASSETS_SAVED_OBJECT_TYPE}.attributes.package_version` } },
};
const oldVersionsAgg = (await savedObjectsClient.find<PackageAssetReference>({
const oldVersionsAgg = await savedObjectsClient.find<PackageAssetReference, any>({
type: ASSETS_SAVED_OBJECT_TYPE,
filter: `${ASSETS_SAVED_OBJECT_TYPE}.attributes.package_name:${pkgName} AND ${ASSETS_SAVED_OBJECT_TYPE}.attributes.package_version<${currentVersion}`,
aggs,
page: 0,
perPage: 0,
})) as any;
});

const oldVersions = oldVersionsAgg.aggregations.versions.buckets.map((obj) => obj.key);
const oldVersions = oldVersionsAgg.aggregations.versions.buckets.map(
(obj: { key: string }) => obj.key
);

for (const oldVersion of oldVersions) {
await removeAssetsFromVersion(savedObjectsClient, pkgName, oldVersion);
Expand Down
2 changes: 0 additions & 2 deletions x-pack/plugins/fleet/server/services/package_policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,6 @@ class PackagePolicyService {
}));
}

i = 0;

public async list(
soClient: SavedObjectsClientContract,
options: ListWithKuery
Expand Down

0 comments on commit 8511eff

Please sign in to comment.