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:
parent
a1d1dc7a24
commit
c5cd659c83
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user