From c87196cfd130b88402865d3fc0ea55888eefc853 Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Fri, 16 Apr 2021 07:35:51 +0200 Subject: [PATCH] fixed creating new ldap settings --- src/user-federation/UserFederationLdapSettings.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) 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(