From 489ed640498a837a2c5a2ef53b2537328a76ebf7 Mon Sep 17 00:00:00 2001 From: mfrances Date: Mon, 22 Feb 2021 09:52:49 -0500 Subject: [PATCH] fix 404 issue on new --- src/user-federation/UserFederationKerberosSettings.tsx | 8 +++++--- src/user-federation/UserFederationLdapSettings.tsx | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/user-federation/UserFederationKerberosSettings.tsx b/src/user-federation/UserFederationKerberosSettings.tsx index 82877c8dbe..d5ac8b02d4 100644 --- a/src/user-federation/UserFederationKerberosSettings.tsx +++ b/src/user-federation/UserFederationKerberosSettings.tsx @@ -93,9 +93,11 @@ export const UserFederationKerberosSettings = () => { useEffect(() => { (async () => { - const fetchedComponent = await adminClient.components.findOne({ id }); - if (fetchedComponent) { - setupForm(fetchedComponent); + if (id !== "new") { + const fetchedComponent = await adminClient.components.findOne({ id }); + if (fetchedComponent) { + setupForm(fetchedComponent); + } } })(); }, []); diff --git a/src/user-federation/UserFederationLdapSettings.tsx b/src/user-federation/UserFederationLdapSettings.tsx index c67781f2b2..2715dc6e20 100644 --- a/src/user-federation/UserFederationLdapSettings.tsx +++ b/src/user-federation/UserFederationLdapSettings.tsx @@ -123,9 +123,11 @@ export const UserFederationLdapSettings = () => { useEffect(() => { (async () => { - const fetchedComponent = await adminClient.components.findOne({ id }); - if (fetchedComponent) { - setupForm(fetchedComponent); + if (id !== "new") { + const fetchedComponent = await adminClient.components.findOne({ id }); + if (fetchedComponent) { + setupForm(fetchedComponent); + } } })(); }, []);