Skip to content

Commit

Permalink
[Fix] Correction to auto logout when request fails
Browse files Browse the repository at this point in the history
  • Loading branch information
sunday Nwuguru committed Jun 9, 2016
1 parent 5d7f8b4 commit 9dad512
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions bucketlist/static/js/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ angular.module('bucketlist.services', [])
}
Util.toast('done!')
}, function(response) {
Util.logout(response);
if(response.status != 404)
Util.logout(response);
});
},
save: function($scope) {
Expand All @@ -103,7 +104,8 @@ angular.module('bucketlist.services', [])
Util.toast('done!')
$scope.getBucketlist('/bucketlists/');
}, function(response) {
Util.logout(response);
if(response.status != 404)
Util.logout(response);
});
},
delete: function(bucketlist_id, $scope) {
Expand All @@ -114,7 +116,8 @@ angular.module('bucketlist.services', [])
$scope.getBucketlist('/bucketlists/');
}
}, function(response) {
Util.logout(response);
if(response.status != 404)
Util.logout(response);
});
}
};
Expand All @@ -137,7 +140,8 @@ angular.module('bucketlist.services', [])
}
Util.toast('done!')
}, function(response) {
Util.logout(response);
if(response.status != 404)
Util.logout(response);
});
},
save: function($scope, toggle) {
Expand All @@ -155,7 +159,8 @@ angular.module('bucketlist.services', [])
}
Util.broadcast($scope.bucketlist_id, $scope.bucketlist_name)
}, function(response) {
Util.logout(response);
if(response.status != 404)
Util.logout(response);
});
},
delete: function($scope) {
Expand All @@ -167,7 +172,8 @@ angular.module('bucketlist.services', [])
$scope.item = {};
}
}, function(response) {
Util.logout(response);
if(response.status != 404)
Util.logout(response);
});
}
};
Expand Down

0 comments on commit 9dad512

Please sign in to comment.