1
0
mirror of https://github.com/bitwarden/web synced 2025-12-06 00:03:28 +00:00

storage for org billing & signup

This commit is contained in:
Kyle Spearrin
2017-07-11 10:24:46 -04:00
parent 25536e10ef
commit ea4d772dda
10 changed files with 127 additions and 14 deletions

View File

@@ -1,15 +1,16 @@
angular
.module('bit.settings')
.controller('settingsPremiumController', function ($scope, $state, apiService, toastr, $analytics, authService, stripe) {
.controller('settingsPremiumController', function ($scope, $state, apiService, toastr, $analytics, authService, stripe,
constants) {
authService.getUserProfile().then(function (profile) {
if (profile.premium) {
return $state.go('backend.user.settingsBilling');
}
});
$scope.storageGbPrice = 4;
$scope.premiumPrice = 10;
$scope.storageGbPrice = constants.storageGb.yearlyPrice;
$scope.premiumPrice = constants.premium.price;
$scope.model = {
additionalStorageGb: null
@@ -28,6 +29,8 @@
return apiService.accounts.postPremium(request).$promise;
}).then(function (result) {
return authService.updateProfilePremium(true);
}).then(function () {
$analytics.eventTrack('Signed Up Premium');
return authService.refreshAccessToken();
}).then(function () {