mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 15:53:27 +00:00
[Provider] Add initial support for providers (#399)
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { BaseResponse } from './baseResponse';
|
||||
import { ProfileOrganizationResponse } from './profileOrganizationResponse';
|
||||
import { ProfileProviderOrganizationResponse } from './profileProviderOrganizationResponse';
|
||||
import { ProfileProviderResponse } from './profileProviderResponse';
|
||||
|
||||
export class ProfileResponse extends BaseResponse {
|
||||
id: string;
|
||||
@@ -14,6 +16,8 @@ export class ProfileResponse extends BaseResponse {
|
||||
privateKey: string;
|
||||
securityStamp: string;
|
||||
organizations: ProfileOrganizationResponse[] = [];
|
||||
providers: ProfileProviderResponse[] = [];
|
||||
providerOrganizations: ProfileProviderOrganizationResponse[] = [];
|
||||
|
||||
constructor(response: any) {
|
||||
super(response);
|
||||
@@ -33,5 +37,13 @@ export class ProfileResponse extends BaseResponse {
|
||||
if (organizations != null) {
|
||||
this.organizations = organizations.map((o: any) => new ProfileOrganizationResponse(o));
|
||||
}
|
||||
const providers = this.getResponseProperty('Providers');
|
||||
if (providers != null) {
|
||||
this.providers = providers.map((o: any) => new ProfileProviderResponse(o));
|
||||
}
|
||||
const providerOrganizations = this.getResponseProperty('ProviderOrganizations');
|
||||
if (providerOrganizations != null) {
|
||||
this.providerOrganizations = providerOrganizations.map((o: any) => new ProfileProviderOrganizationResponse(o));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user