1
0
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:
Kyle Spearrin
2017-03-11 20:46:33 -05:00
parent 1cbd322105
commit 0acab61f2e
3 changed files with 46 additions and 3 deletions

View File

@@ -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;