mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 18:40:01 -03:30
Fixed a few straggling success/error promises and replaced with then/catch
This commit is contained in:
parent
03cef6fea3
commit
f9b0a3121f
@ -138,16 +138,16 @@ export default
|
||||
this.url = GetBasePath('inventory_sources') + id + '/hosts/';
|
||||
Rest.setUrl(this.url);
|
||||
return Rest.destroy()
|
||||
.success(this.success.bind(this))
|
||||
.error(this.error.bind(this))
|
||||
.then(this.success.bind(this))
|
||||
.catch(this.error.bind(this))
|
||||
.finally();
|
||||
},
|
||||
deleteGroups(id) {
|
||||
this.url = GetBasePath('inventory_sources') + id + '/groups/';
|
||||
Rest.setUrl(this.url);
|
||||
return Rest.destroy()
|
||||
.success(this.success.bind(this))
|
||||
.error(this.error.bind(this))
|
||||
.then(this.success.bind(this))
|
||||
.catch(this.error.bind(this))
|
||||
.finally();
|
||||
}
|
||||
};
|
||||
|
||||
@ -92,7 +92,7 @@ export default ['$stateParams', '$scope', '$rootScope',
|
||||
$scope.$on("ReloadOrgListView", function() {
|
||||
Rest.setUrl($scope.current_url);
|
||||
Rest.get()
|
||||
.success((data) => $scope.organizations = data.results)
|
||||
.then(({data}) => $scope.organizations = data.results)
|
||||
.catch(({data, status}) => {
|
||||
ProcessErrors($scope, data, status, null, {
|
||||
hdr: 'Error!',
|
||||
|
||||
@ -919,9 +919,9 @@ export default ['$state','moment', '$timeout', '$window', '$filter', 'Rest', 'Ge
|
||||
|
||||
Rest.setUrl(GetBasePath("unified_jobs") + "?id=" + d.job.id);
|
||||
Rest.get()
|
||||
.success(function (res) {
|
||||
if(res.results && res.results.length > 0) {
|
||||
goToJobResults(res.results[0].type);
|
||||
.then(function (res) {
|
||||
if(res.data.results && res.data.results.length > 0) {
|
||||
goToJobResults(res.data.results[0].type);
|
||||
}
|
||||
})
|
||||
.catch(({data, status}) => {
|
||||
|
||||
@ -58,13 +58,13 @@ export default {
|
||||
// Get the workflow nodes
|
||||
Rest.setUrl(nextUrl);
|
||||
Rest.get()
|
||||
.success(function(nextData) {
|
||||
for(var i=0; i<nextData.results.length; i++) {
|
||||
allNodes.push(nextData.results[i]);
|
||||
.then(function(nextData) {
|
||||
for(var i=0; i<nextData.data.results.length; i++) {
|
||||
allNodes.push(nextData.data.results[i]);
|
||||
}
|
||||
if(nextData.next) {
|
||||
if(nextData.data.next) {
|
||||
// Get the next page
|
||||
getNodes(nextData.next);
|
||||
getNodes(nextData.data.next);
|
||||
}
|
||||
else {
|
||||
defer.resolve(allNodes);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user