#214: update list of refs on error

This commit is contained in:
Vokhmin Alexey V 2013-07-18 22:02:18 +04:00
parent aadb77cf56
commit 61e4154deb
1 changed files with 3 additions and 1 deletions

View File

@ -46,9 +46,11 @@ RosaABF.controller('ProjectRefsController', ['$scope', '$http', 'ApiProject', fu
$scope.destroy = function(branch) {
$scope.project_resource.$delete_branch(
{owner: $scope.project.owner.uname, project: $scope.project.name, ref: branch.ref},
function() {
function() { // on success
var i = $scope.branches.indexOf(branch);
if(i != -1) { $scope.branches.splice(i, 1); }
}, function () { // on error
$scope.getRefs();
}
);
}