[Fleet] Do not display inactive enrollment token in the agent enrollment flyout (#87300)

This commit is contained in:
Nicolas Chaulet 2021-01-05 13:48:33 -04:00 committed by GitHub
parent 16ad4d6685
commit a4bbf470e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -110,7 +110,9 @@ export const EnrollmentStepAgentPolicy: React.FC<Props> = (props) => {
}
setEnrollmentAPIKeys(
res.data.list.filter((key) => key.policy_id === selectedState.agentPolicyId)
res.data.list.filter(
(key) => key.policy_id === selectedState.agentPolicyId && key.active === true
)
);
} catch (error) {
notifications.toasts.addError(error, {