From 9f8691dbeac4967053501432e0230aa352589335 Mon Sep 17 00:00:00 2001 From: mabashian Date: Thu, 18 Jun 2020 16:16:35 -0400 Subject: [PATCH] Add the credential id and metadata from the form to the dependency array of useCallback when testing cred plugin configuration. This allows us to remove the variables passed in to the request. --- .../CredentialPluginPrompt/MetadataStep.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/awx/ui_next/src/screens/Credential/shared/CredentialPlugins/CredentialPluginPrompt/MetadataStep.jsx b/awx/ui_next/src/screens/Credential/shared/CredentialPlugins/CredentialPluginPrompt/MetadataStep.jsx index 29dac08080..acbabd551b 100644 --- a/awx/ui_next/src/screens/Credential/shared/CredentialPlugins/CredentialPluginPrompt/MetadataStep.jsx +++ b/awx/ui_next/src/screens/Credential/shared/CredentialPlugins/CredentialPluginPrompt/MetadataStep.jsx @@ -34,11 +34,11 @@ function MetadataStep({ i18n }) { request: testPluginMetadata, } = useRequest( useCallback( - async (credential, metadata) => - CredentialsAPI.test(credential.id, { - metadata, + async () => + CredentialsAPI.test(selectedCredential.value.id, { + metadata: inputValues.value, }), - [] + [selectedCredential.value.id, inputValues.value] ), null ); @@ -159,7 +159,7 @@ function MetadataStep({ i18n }) { variant="primary" type="submit" onClick={() => - testPluginMetadata(selectedCredential.value, inputValues.value) + testPluginMetadata() } > {i18n._(t`Test`)}