Add remove role functionality.

This commit is contained in:
Kia Lam
2019-03-08 13:56:27 -05:00
parent e935776067
commit 3b65068258
11 changed files with 202 additions and 46 deletions

View File

@@ -112,7 +112,7 @@ class Organization extends Component {
return (
<PageSection>
<Card>
<Card className="awx-c-card">
{ cardHeader }
<Switch>
<Redirect

View File

@@ -6,6 +6,7 @@ class OrganizationAccess extends React.Component {
super(props);
this.getOrgAccessList = this.getOrgAccessList.bind(this);
this.removeRole = this.removeRole.bind(this);
}
getOrgAccessList (id, params) {
@@ -13,6 +14,11 @@ class OrganizationAccess extends React.Component {
return api.getOrganzationAccessList(id, params);
}
removeRole (url, id) {
const { api } = this.props;
return api.disassociate(url, id);
}
render () {
const {
location,
@@ -23,6 +29,7 @@ class OrganizationAccess extends React.Component {
return (
<AccessList
getAccessList={this.getOrgAccessList}
removeRole={this.removeRole}
match={match}
location={location}
history={history}

View File

@@ -171,7 +171,7 @@ class OrganizationEdit extends Component {
await api.associateInstanceGroup(url, id);
}));
await Promise.all(groupsToDisassociate.map(async id => {
await api.disassociateInstanceGroup(url, id);
await api.disassociate(url, id);
}));
} catch (err) {
this.setState({ error: err });