mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 11:20:39 -03:30
Build inputSourcesMap using an array reduce method instead of forEach with a local variable.
This commit is contained in:
parent
5367bc4d3b
commit
78ade1d99d
@ -37,11 +37,12 @@ function CredentialEdit({ credential, me }) {
|
||||
CredentialsAPI.readInputSources(credential.id, { page_size: 200 }),
|
||||
]);
|
||||
setCredentialTypes(loadedCredentialTypes);
|
||||
const inputSourcesMap = {};
|
||||
loadedInputSources.forEach(inputSource => {
|
||||
inputSourcesMap[inputSource.input_field_name] = inputSource;
|
||||
});
|
||||
setInputSources(inputSourcesMap);
|
||||
setInputSources(
|
||||
loadedInputSources.reduce((inputSourcesMap, inputSource) => {
|
||||
inputSourcesMap[inputSource.input_field_name] = inputSource;
|
||||
return inputSourcesMap;
|
||||
}, {})
|
||||
);
|
||||
} catch (err) {
|
||||
setError(err);
|
||||
} finally {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user