mirror of
https://github.com/ansible/awx.git
synced 2026-04-19 08:50:21 -02:30
Code cleanup, renaming functions, use .all() on config promises
This commit is contained in:
@@ -78,28 +78,19 @@ class Provider extends Component {
|
||||
const { api, handleHttpError } = this.props;
|
||||
|
||||
try {
|
||||
const {
|
||||
data: {
|
||||
ansible_version,
|
||||
custom_virtualenvs,
|
||||
version
|
||||
}
|
||||
} = await api.getConfig();
|
||||
const {
|
||||
data: {
|
||||
custom_logo,
|
||||
custom_login_info
|
||||
}
|
||||
} = await api.getRoot();
|
||||
const { data: { results: [me] } } = await api.getMe();
|
||||
const [configRes, rootRes, meRes] = await Promise.all([
|
||||
api.getConfig(),
|
||||
api.getRoot(),
|
||||
api.getMe()
|
||||
]);
|
||||
this.setState({
|
||||
value: {
|
||||
ansible_version,
|
||||
custom_virtualenvs,
|
||||
version,
|
||||
custom_logo,
|
||||
custom_login_info,
|
||||
me
|
||||
ansible_version: configRes.data.ansible_version,
|
||||
custom_virtualenvs: configRes.data.custom_virtualenvs,
|
||||
version: configRes.data.version,
|
||||
custom_logo: rootRes.data.custom_logo,
|
||||
custom_login_info: rootRes.data.custom_login_info,
|
||||
me: meRes.data.results
|
||||
}
|
||||
});
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user