Fix error display in create repo view

Fixes #1575
This commit is contained in:
Joseph Schorr 2016-06-23 16:24:36 -04:00
parent 1173192739
commit 5db20229aa
2 changed files with 9 additions and 7 deletions

View file

@ -53,9 +53,11 @@
return true;
};
$scope.createNewRepo = function() {
$('#repoName').popover('hide');
$scope.$watch('repo.name', function() {
$scope.createError = null;
});
$scope.createNewRepo = function() {
$scope.creating = true;
var repo = $scope.repo;
var data = {
@ -86,10 +88,7 @@
$location.path('/repository/' + created.namespace + '/' + created.name);
}, function(result) {
$scope.creating = false;
$scope.createError = result.data ? result.data.message : 'Cannot create repository';
$timeout(function() {
$('#repoName').popover('show');
});
$scope.createError = ApiService.getErrorMessage(result);
});
};
}