From 08d79120495442f0f2bdf81810de63b768d0f818 Mon Sep 17 00:00:00 2001 From: Marcin Maciaszczyk Date: Fri, 18 Oct 2024 12:26:09 +0200 Subject: [PATCH] small adjustments --- .../clusters/plural-cloud/EditPluralOIDCClient.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/www/src/components/overview/clusters/plural-cloud/EditPluralOIDCClient.tsx b/www/src/components/overview/clusters/plural-cloud/EditPluralOIDCClient.tsx index 7caa866e6..6611be513 100644 --- a/www/src/components/overview/clusters/plural-cloud/EditPluralOIDCClient.tsx +++ b/www/src/components/overview/clusters/plural-cloud/EditPluralOIDCClient.tsx @@ -56,7 +56,6 @@ function EditPluralOIDCClient({ provider?: OidcProviderFragment }) { const theme = useTheme() - const createMode = !provider const [name, setName] = useState(provider?.name ?? '') const [description, setDescription] = useState(provider?.description ?? '') const [bindings, setBindings] = useState(provider?.bindings ?? []) @@ -95,10 +94,10 @@ function EditPluralOIDCClient({ onClose() }, [onClose]) - const [mutation, { loading, error }] = createMode + const [mutation, { loading, error }] = !provider ? useCreateProviderMutation({ variables: { attributes }, onCompleted }) : useUpdateProviderMutation({ - variables: { id: provider.id, attributes }, // FIXME + variables: { id: provider.id, attributes }, onCompleted, }) @@ -212,7 +211,7 @@ function EditPluralOIDCClient({ )} @@ -228,7 +227,7 @@ function EditPluralOIDCClient({ loading={loading} onClick={mutation} > - {createMode ? 'Create' : 'Save'} + {!provider ? 'Create' : 'Save'}