mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 03:10:42 -03:30
use Promise.all to make requests in parallel
This commit is contained in:
parent
adc68b672d
commit
c58c7e285c
@ -132,10 +132,12 @@ function HostFilterLookup({
|
||||
useCallback(
|
||||
async orgId => {
|
||||
const params = parseQueryString(QS_CONFIG, location.search);
|
||||
const { data } = await HostsAPI.read(
|
||||
mergeParams(params, { inventory__organization: orgId })
|
||||
);
|
||||
const { data: actions } = await HostsAPI.readOptions();
|
||||
const [{ data }, { data: actions }] = await Promise.all([
|
||||
HostsAPI.read(
|
||||
mergeParams(params, { inventory__organization: orgId })
|
||||
),
|
||||
HostsAPI.readOptions(),
|
||||
]);
|
||||
return {
|
||||
count: data.count,
|
||||
hosts: data.results,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user