[Fleet] Fix policy count in output edit modal (#122267) (#122278)

Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
This commit is contained in:
Kibana Machine 2022-01-04 13:42:08 -05:00 committed by GitHub
parent c0d416b803
commit 3906188cbb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,7 +7,7 @@
import { sendGetAgentPolicies, sendGetAgents } from '../../../hooks';
import type { Output } from '../../../types';
import { AGENT_POLICY_SAVED_OBJECT_TYPE } from '../../../constants';
import { AGENT_POLICY_SAVED_OBJECT_TYPE, SO_SEARCH_LIMIT } from '../../../constants';
export async function getAgentAndPolicyCountForOutput(output: Output) {
let kuery = `${AGENT_POLICY_SAVED_OBJECT_TYPE}.data_output_id:"${output.id}" or ${AGENT_POLICY_SAVED_OBJECT_TYPE}.monitoring_output_id:"${output.id}"`;
@ -16,6 +16,8 @@ export async function getAgentAndPolicyCountForOutput(output: Output) {
}
const agentPolicies = await sendGetAgentPolicies({
kuery,
page: 1,
perPage: SO_SEARCH_LIMIT,
});
if (agentPolicies.error) {