update Promise.all map functions to not be async

This commit is contained in:
John Mitchell
2019-04-12 14:35:35 -04:00
parent b9e0b2e0ad
commit 63894bf822
3 changed files with 5 additions and 10 deletions

View File

@@ -36,9 +36,8 @@ class OrganizationAdd extends React.Component {
const { data: response } = await api.createOrganization(values);
const instanceGroupsUrl = response.related.instance_groups;
try {
await Promise.all(groupsToAssociate.map(async id => {
await api.associateInstanceGroup(instanceGroupsUrl, id);
}));
await Promise.all(groupsToAssociate.map(id => api
.associateInstanceGroup(instanceGroupsUrl, id)));
this.handleSuccess(response.id);
} catch (err) {
handleHttpError(err) || this.setState({ error: err });