Skip to content

Commit

Permalink
Fix type errors again
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-tavares committed Oct 24, 2024
1 parent 88c9827 commit 06c74ca
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,10 @@ const fetchEndpointPolicyNamespace = async ({
}

for (const integrationPolicyId of integrationPolicies) {
response.integrationPolicy[integrationPolicyId] = retrievedIntegrationPolicies[
integrationPolicyId
].namespace
? [retrievedIntegrationPolicies[integrationPolicyId].namespace]
const integrationPolicyNamespace = retrievedIntegrationPolicies[integrationPolicyId].namespace;

response.integrationPolicy[integrationPolicyId] = integrationPolicyNamespace
? [integrationPolicyNamespace]
: retrievedIntegrationPolicies[integrationPolicyId].policy_ids.map((agentPolicyId) => {
return retrievedAgentPolicies[agentPolicyId].namespace;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ jest.mock('./handlers/create_policy_datastreams', () => {
};
});

const createPolicyDataStreamsIfNeededMock = _createPolicyDataStreamsIfNeeded as jest.Mock;
const createPolicyDataStreamsIfNeededMock =
_createPolicyDataStreamsIfNeeded as unknown as jest.Mock;

describe('Fleet integrations', () => {
let endpointAppContextStartContract: EndpointAppContextServiceStartContract;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ export const getPackagePolicyPostUpdateCallback = (
createPolicyDataStreamsIfNeeded({
endpointServices,
endpointPolicyIds: [packagePolicy.id],
});
}).catch(() => {}); // to silence @typescript-eslint/no-floating-promises

return packagePolicy;
};
Expand All @@ -349,7 +349,7 @@ export const getPackagePolicyPostCreateCallback = (
createPolicyDataStreamsIfNeeded({
endpointServices,
endpointPolicyIds: [packagePolicy.id],
});
}).catch(() => {}); // to silence @typescript-eslint/no-floating-promises

const integrationConfig = packagePolicy?.inputs[0]?.config?.integration_config;

Expand Down Expand Up @@ -434,7 +434,7 @@ export const getAgentPolicyPostUpdateCallback = (
createPolicyDataStreamsIfNeeded({
endpointServices,
endpointPolicyIds: [endpointPolicy.id],
});
}).catch(() => {}); // to silence @typescript-eslint/no-floating-promises

return agentPolicy;
};
Expand Down

0 comments on commit 06c74ca

Please sign in to comment.