mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 00:33:44 +00:00
add new org to profile
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
.module('bit.settings')
|
||||
|
||||
.controller('settingsCreateOrganizationController', function ($scope, $state, apiService, $uibModalInstance, cryptoService,
|
||||
toastr, $analytics) {
|
||||
toastr, $analytics, authService) {
|
||||
$analytics.eventTrack('settingsCreateOrganizationController', { category: 'Modal' });
|
||||
|
||||
$scope.model = {
|
||||
@@ -16,10 +16,11 @@
|
||||
key: cryptoService.makeShareKey()
|
||||
};
|
||||
|
||||
$scope.submitPromise = apiService.organizations.post(request, function () {
|
||||
$scope.submitPromise = apiService.organizations.post(request, function (result) {
|
||||
$uibModalInstance.dismiss('cancel');
|
||||
$analytics.eventTrack('Created Organization');
|
||||
$state.go('backend.org.dashboard').then(function () {
|
||||
authService.addProfileOrganization(result);
|
||||
$state.go('backend.org.dashboard', { orgId: result.Id }).then(function () {
|
||||
toastr.success('Your new organization is ready to go!', 'Organization Created');
|
||||
});
|
||||
}).$promise;
|
||||
|
||||
Reference in New Issue
Block a user