1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-04 17:43:39 +00:00

org billing settings setup

This commit is contained in:
Kyle Spearrin
2018-07-16 17:17:07 -04:00
parent 786f6953e7
commit 0650cafb28
17 changed files with 501 additions and 26 deletions

View File

@@ -20,7 +20,7 @@ import { StorageRequest } from 'jslib/models/request/storageRequest';
export class AdjustStorageComponent {
@Input() storageGbPrice = 0;
@Input() add = true;
@Input() user = true;
@Input() organizationId: string;
@Input() interval = 'year';
@Output() onAdjusted = new EventEmitter<number>();
@Output() onCanceled = new EventEmitter();
@@ -39,8 +39,10 @@ export class AdjustStorageComponent {
request.storageGbAdjustment *= -1;
}
if (this.user) {
if (this.organizationId == null) {
this.formPromise = this.apiService.postAccountStorage(request);
} else {
this.formPromise = this.apiService.postOrganizationStorage(this.organizationId, request);
}
await this.formPromise;
this.analytics.eventTrack.next({ action: this.add ? 'Added Storage' : 'Removed Storage' });