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.

This commit is contained in:
mabashian 2020-06-18 16:16:35 -04:00
parent 62054bbfc8
commit 9f8691dbea

View File

@ -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`)}