mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 17:37:37 -02:30
Merge pull request #1632 from jaredevantabor/1507-error-message
fixes error handling with groups service, sources service
This commit is contained in:
@@ -49,10 +49,10 @@ export default ['$state', '$stateParams', '$scope', 'GroupForm',
|
|||||||
};
|
};
|
||||||
|
|
||||||
GroupsService.post(group).then(res => {
|
GroupsService.post(group).then(res => {
|
||||||
if ($stateParams.group_id) {
|
if ($stateParams.group_id && _.has(res, 'data')) {
|
||||||
return GroupsService.associateGroup(res.data, $stateParams.group_id)
|
return GroupsService.associateGroup(res.data, $stateParams.group_id)
|
||||||
.then(() => $state.go('^', null, { reload: true }));
|
.then(() => $state.go('^', null, { reload: true }));
|
||||||
} else {
|
} else if(_.has(res, 'data.id')){
|
||||||
$state.go('^.edit', { group_id: res.data.id }, { reload: true });
|
$state.go('^.edit', { group_id: res.data.id }, { reload: true });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export default ['$state', '$stateParams', '$scope', 'NestedGroupForm',
|
|||||||
};
|
};
|
||||||
|
|
||||||
GroupsService.post(group).then(res => {
|
GroupsService.post(group).then(res => {
|
||||||
if ($stateParams.group_id) {
|
if ($stateParams.group_id && _.has(res, 'data')) {
|
||||||
return GroupsService.associateGroup(res.data, $stateParams.group_id)
|
return GroupsService.associateGroup(res.data, $stateParams.group_id)
|
||||||
.then(() => $state.go('^', null, { reload: true }));
|
.then(() => $state.go('^', null, { reload: true }));
|
||||||
} else {
|
} else if(_.has(res, 'data.id')){
|
||||||
$state.go('^.edit', { group_id: res.data.id }, { reload: true });
|
$state.go('^.edit', { group_id: res.data.id }, { reload: true });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ export default
|
|||||||
url: function(){
|
url: function(){
|
||||||
return '';
|
return '';
|
||||||
},
|
},
|
||||||
error: function(data, status) {
|
error: function(data) {
|
||||||
ProcessErrors($rootScope, data, status, null, { hdr: 'Error!',
|
ProcessErrors($rootScope, data.data, data.status, null, { hdr: 'Error!',
|
||||||
msg: 'Call to ' + this.url + '. GET returned: ' + status });
|
msg: 'Call to ' + this.url + '. GET returned: ' + data.status });
|
||||||
},
|
},
|
||||||
success: function(data){
|
success: function(data){
|
||||||
return data;
|
return data;
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ export default
|
|||||||
url: function(){
|
url: function(){
|
||||||
return '';
|
return '';
|
||||||
},
|
},
|
||||||
error: function(data, status) {
|
error: function(data) {
|
||||||
ProcessErrors($rootScope, data, status, null, { hdr: 'Error!',
|
ProcessErrors($rootScope, data.data, data.status, null, { hdr: 'Error!',
|
||||||
msg: 'Call to ' + this.url + '. GET returned: ' + status });
|
msg: 'Call to ' + this.url + '. GET returned: ' + data.status });
|
||||||
},
|
},
|
||||||
success: function(data){
|
success: function(data){
|
||||||
return data;
|
return data;
|
||||||
|
|||||||
Reference in New Issue
Block a user