mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 15:53:27 +00:00
react to policy api changes
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { DeviceType } from '../enums/deviceType';
|
||||
import { PolicyType } from '../enums/policyType';
|
||||
|
||||
import { ApiService as ApiServiceAbstraction } from '../abstractions/api.service';
|
||||
import { PlatformUtilsService } from '../abstractions/platformUtils.service';
|
||||
@@ -553,8 +554,8 @@ export class ApiService implements ApiServiceAbstraction {
|
||||
|
||||
// Policy APIs
|
||||
|
||||
async getPolicy(organizationId: string, id: string): Promise<PolicyResponse> {
|
||||
const r = await this.send('GET', '/organizations/' + organizationId + '/policies/' + id, null, true, true);
|
||||
async getPolicy(organizationId: string, type: PolicyType): Promise<PolicyResponse> {
|
||||
const r = await this.send('GET', '/organizations/' + organizationId + '/policies/' + type, null, true, true);
|
||||
return new PolicyResponse(r);
|
||||
}
|
||||
|
||||
@@ -563,20 +564,11 @@ export class ApiService implements ApiServiceAbstraction {
|
||||
return new ListResponse(r, PolicyResponse);
|
||||
}
|
||||
|
||||
async postPolicy(organizationId: string, request: PolicyRequest): Promise<PolicyResponse> {
|
||||
const r = await this.send('POST', '/organizations/' + organizationId + '/policies', request, true, true);
|
||||
async putPolicy(organizationId: string, type: PolicyType, request: PolicyRequest): Promise<PolicyResponse> {
|
||||
const r = await this.send('PUT', '/organizations/' + organizationId + '/policies/' + type, request, true, true);
|
||||
return new PolicyResponse(r);
|
||||
}
|
||||
|
||||
async putPolicy(organizationId: string, id: string, request: PolicyRequest): Promise<PolicyResponse> {
|
||||
const r = await this.send('PUT', '/organizations/' + organizationId + '/policies/' + id, request, true, true);
|
||||
return new PolicyResponse(r);
|
||||
}
|
||||
|
||||
deletePolicy(organizationId: string, id: string): Promise<any> {
|
||||
return this.send('DELETE', '/organizations/' + organizationId + '/policies/' + id, null, true, false);
|
||||
}
|
||||
|
||||
// Organization User APIs
|
||||
|
||||
async getOrganizationUser(organizationId: string, id: string): Promise<OrganizationUserDetailsResponse> {
|
||||
|
||||
Reference in New Issue
Block a user