1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

Redirect user to org detail page after successful POST.

This commit is contained in:
kialam 2019-01-08 16:09:30 -05:00
parent a1d1dc7a24
commit c5cd659c83
No known key found for this signature in database
GPG Key ID: 2D0E60E4B8C7EA0F

View File

@ -75,6 +75,7 @@ class OrganizationAdd extends React.Component {
const data = Object.assign({}, { ...this.state });
try {
const { data: response } = await api.createOrganization(data);
console.log(response);
const url = response.related.instance_groups;
const selected = this.state.results.filter(group => group.isChecked);
try {
@ -82,17 +83,23 @@ class OrganizationAdd extends React.Component {
this.resetForm();
} catch (err) {
this.setState({ createInstanceGroupsError: err })
} finally {
this.onSuccess(response.id);
}
}
catch (err) {
this.setState({ onSubmitError: err })
}
}
}
onCancel() {
this.props.history.push('/organizations');
}
onSuccess(id) {
this.props.history.push(`/organizations/${id}`);
}
async componentDidMount() {
const { api } = this.props;
try {