diff --git a/src/user-federation/UserFederationLdapSettings.tsx b/src/user-federation/UserFederationLdapSettings.tsx index a87ebe6e2c..0be9a47bde 100644 --- a/src/user-federation/UserFederationLdapSettings.tsx +++ b/src/user-federation/UserFederationLdapSettings.tsx @@ -211,13 +211,11 @@ export const UserFederationLdapSettings = () => { const save = async (component: ComponentRepresentation) => { try { - if (id) { - if (id === "new") { - await adminClient.components.create(component); - history.push(`/${realm}/user-federation`); - } else { - await adminClient.components.update({ id }, component); - } + if (!id) { + await adminClient.components.create(component); + history.push(`/${realm}/user-federation`); + } else { + await adminClient.components.update({ id }, component); } setupForm(component as ComponentRepresentation); addAlert(