1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-27 12:36:14 +01:00

handle errors in org people edit

This commit is contained in:
Kyle Spearrin 2017-03-29 21:26:48 -04:00
parent 916519a43a
commit 616a442fcb
2 changed files with 9 additions and 2 deletions

View File

@ -69,6 +69,7 @@
return Object.keys($scope.selectedSubvaults).length === $scope.subvaults.length;
};
$scope.submitPromise = null;
$scope.submit = function (model) {
var subvaults = [];
for (var subvaultId in $scope.selectedSubvaults) {
@ -77,12 +78,12 @@
}
}
apiService.organizationUsers.put({ orgId: $state.params.orgId, id: id }, {
$scope.submitPromise = apiService.organizationUsers.put({ orgId: $state.params.orgId, id: id }, {
type: $scope.type,
subvaults: subvaults
}, function () {
$uibModalInstance.close();
});
}).$promise;
};
$scope.close = function () {

View File

@ -4,6 +4,12 @@
</div>
<form name="form" ng-submit="form.$valid && submit()" api-form="submitPromise">
<div class="modal-body">
<div class="callout callout-danger validation-errors" ng-show="form.$errors">
<h4>Errors have occured</h4>
<ul>
<li ng-repeat="e in form.$errors">{{e}}</li>
</ul>
</div>
<h4>User Type</h4>
<div class="form-group">
<div class="radio">