1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-12 14:23:32 +00:00

[refactor(Account Switching)] Implement StateService (#424)

This commit is contained in:
Addison Beck
2021-12-28 15:38:51 -05:00
committed by GitHub
parent eb122532bd
commit 179f1dfe5d
16 changed files with 144 additions and 118 deletions

View File

@@ -1,6 +1,6 @@
import * as program from "commander";
import { ImportService } from "jslib-common/abstractions/import.service";
import { UserService } from "jslib-common/abstractions/user.service";
import { OrganizationService } from "jslib-common/abstractions/organization.service";
import { Response } from "jslib-node/cli/models/response";
import { MessageResponse } from "jslib-node/cli/models/response/messageResponse";
@@ -8,12 +8,15 @@ import { MessageResponse } from "jslib-node/cli/models/response/messageResponse"
import { CliUtils } from "../utils";
export class ImportCommand {
constructor(private importService: ImportService, private userService: UserService) {}
constructor(
private importService: ImportService,
private organizationService: OrganizationService
) {}
async run(format: string, filepath: string, options: program.OptionValues): Promise<Response> {
const organizationId = options.organizationid;
if (organizationId != null) {
const organization = await this.userService.getOrganization(organizationId);
const organization = await this.organizationService.get(organizationId);
if (organization == null) {
return Response.badRequest(