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

This commit is contained in:
Nicolas Chaulet 2021-01-05 17:14:33 -04:00 committed by GitHub
parent 9044b515ab
commit 1e807e7701
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, {