Skip to content

Commit

Permalink
small adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
maciaszczykm committed Oct 18, 2024
1 parent 8ee7080 commit 08d7912
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<any>(provider?.bindings ?? [])
Expand Down Expand Up @@ -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,
})

Expand Down Expand Up @@ -212,7 +211,7 @@ function EditPluralOIDCClient({
<GqlError
error={error}
header={`${
createMode ? 'Create' : 'Edit'
!provider ? 'Create' : 'Edit'
} OIDC provider request failed`}
/>
)}
Expand All @@ -228,7 +227,7 @@ function EditPluralOIDCClient({
loading={loading}
onClick={mutation}
>
{createMode ? 'Create' : 'Save'}
{!provider ? 'Create' : 'Save'}
</Button>
</div>
</div>
Expand Down

0 comments on commit 08d7912

Please sign in to comment.