mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 17:23:37 +00:00
[SM-288] Rename requests and responses to follow naming convention (#3806)
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import { ImportDirectoryRequest } from "./import-directory.request";
|
||||
import { OrganizationImportGroupRequest } from "./organization-import-group.request";
|
||||
import { OrganizationImportMemberRequest } from "./organization-import-member.request";
|
||||
|
||||
export class OrganizationImportRequest {
|
||||
groups: OrganizationImportGroupRequest[] = [];
|
||||
members: OrganizationImportMemberRequest[] = [];
|
||||
overwriteExisting = false;
|
||||
largeImport = false;
|
||||
|
||||
constructor(
|
||||
model:
|
||||
| {
|
||||
groups: Required<OrganizationImportGroupRequest>[];
|
||||
users: Required<OrganizationImportMemberRequest>[];
|
||||
overwriteExisting: boolean;
|
||||
largeImport: boolean;
|
||||
}
|
||||
| ImportDirectoryRequest
|
||||
) {
|
||||
if (model instanceof ImportDirectoryRequest) {
|
||||
this.groups = model.groups.map((g) => new OrganizationImportGroupRequest(g));
|
||||
this.members = model.users.map((u) => new OrganizationImportMemberRequest(u));
|
||||
} else {
|
||||
this.groups = model.groups.map((g) => new OrganizationImportGroupRequest(g));
|
||||
this.members = model.users.map((u) => new OrganizationImportMemberRequest(u));
|
||||
}
|
||||
this.overwriteExisting = model.overwriteExisting;
|
||||
this.largeImport = model.largeImport;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user