mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 15:53:27 +00:00
SG-680 - Domain verification progress - (1) Table layout + loading working for the most part (more translations needed (2) Add & edit opening dialog (3) Dialog first draft of save and verify
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { OrganizationDomainRequest } from "../../services/organization-domain/requests/organization-domain.request";
|
||||
|
||||
import { OrganizationDomainResponse } from "./responses/organization-domain.response";
|
||||
|
||||
export abstract class OrgDomainApiServiceAbstraction {
|
||||
@@ -6,7 +8,10 @@ export abstract class OrgDomainApiServiceAbstraction {
|
||||
orgId: string,
|
||||
orgDomainId: string
|
||||
) => Promise<OrganizationDomainResponse>;
|
||||
post: (orgId: string, orgDomain: OrganizationDomainResponse) => Promise<any>;
|
||||
post: (
|
||||
orgId: string,
|
||||
orgDomain: OrganizationDomainRequest
|
||||
) => Promise<OrganizationDomainResponse>;
|
||||
verify: (orgId: string, orgDomainId: string) => Promise<boolean>;
|
||||
delete: (orgId: string, orgDomainId: string) => Promise<any>;
|
||||
}
|
||||
|
||||
@@ -45,13 +45,14 @@ export class OrgDomainApiService implements OrgDomainApiServiceAbstraction {
|
||||
return response;
|
||||
}
|
||||
|
||||
async post(orgId: string, orgDomain: OrganizationDomainResponse): Promise<any> {
|
||||
const request = new OrganizationDomainRequest(orgDomain);
|
||||
|
||||
async post(
|
||||
orgId: string,
|
||||
orgDomainReq: OrganizationDomainRequest
|
||||
): Promise<OrganizationDomainResponse> {
|
||||
const result = await this.apiService.send(
|
||||
"POST",
|
||||
`/organizations/${orgId}`,
|
||||
request,
|
||||
`/organizations/${orgId}/domain`,
|
||||
orgDomainReq,
|
||||
true,
|
||||
true
|
||||
);
|
||||
@@ -66,7 +67,7 @@ export class OrgDomainApiService implements OrgDomainApiServiceAbstraction {
|
||||
async verify(orgId: string, orgDomainId: string): Promise<boolean> {
|
||||
const result: boolean = await this.apiService.send(
|
||||
"POST",
|
||||
`/organizations/${orgId}/${orgDomainId}/verify`,
|
||||
`/organizations/${orgId}/domain/${orgDomainId}/verify`,
|
||||
null,
|
||||
true,
|
||||
true
|
||||
@@ -76,7 +77,13 @@ export class OrgDomainApiService implements OrgDomainApiServiceAbstraction {
|
||||
}
|
||||
|
||||
async delete(orgId: string, orgDomainId: string): Promise<any> {
|
||||
this.apiService.send("DELETE", `/organizations/${orgId}/${orgDomainId}`, null, true, false);
|
||||
this.apiService.send(
|
||||
"DELETE",
|
||||
`/organizations/${orgId}/domain/${orgDomainId}`,
|
||||
null,
|
||||
true,
|
||||
false
|
||||
);
|
||||
this.orgDomainService.delete([orgDomainId]);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
import { OrganizationDomainResponse } from "../../../abstractions/organization-domain/responses/organization-domain.response";
|
||||
|
||||
export class OrganizationDomainRequest {
|
||||
txt: string;
|
||||
domainName: string;
|
||||
|
||||
constructor(orgDomainResponse: OrganizationDomainResponse) {
|
||||
this.txt = orgDomainResponse.txt;
|
||||
this.domainName = orgDomainResponse.domainName;
|
||||
constructor(txt: string, domainName: string) {
|
||||
this.txt = txt;
|
||||
this.domainName = domainName;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user