mirror of
https://github.com/bitwarden/web
synced 2026-01-10 04:23:28 +00:00
subvault listing search and edit subvault
This commit is contained in:
26
src/app/organization/organizationSubvaultsEditController.js
Normal file
26
src/app/organization/organizationSubvaultsEditController.js
Normal file
@@ -0,0 +1,26 @@
|
||||
angular
|
||||
.module('bit.organization')
|
||||
|
||||
.controller('organizationSubvaultsEditController', function ($scope, $state, $uibModalInstance, apiService, cipherService,
|
||||
$analytics, id) {
|
||||
$scope.subvault = {};
|
||||
|
||||
$uibModalInstance.opened.then(function () {
|
||||
apiService.subvaults.get({ orgId: $state.params.orgId, id: id }, function (subvault) {
|
||||
$scope.subvault = cipherService.decryptSubvault(subvault);
|
||||
});
|
||||
});
|
||||
|
||||
$scope.submit = function (model) {
|
||||
var subvault = cipherService.encryptSubvault(model, $state.params.orgId);
|
||||
$scope.submitPromise = apiService.subvaults.put({ orgId: $state.params.orgId }, subvault, function (response) {
|
||||
$analytics.eventTrack('Edited Subvault');
|
||||
var decSubvault = cipherService.decryptSubvault(response, $state.params.orgId, true);
|
||||
$uibModalInstance.close(decSubvault);
|
||||
}).$promise;
|
||||
};
|
||||
|
||||
$scope.close = function () {
|
||||
$uibModalInstance.dismiss('cancel');
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user