diff --git a/apps/web/src/app/vault/individual-vault/bulk-action-dialogs/bulk-delete-dialog/bulk-delete-dialog.component.ts b/apps/web/src/app/vault/individual-vault/bulk-action-dialogs/bulk-delete-dialog/bulk-delete-dialog.component.ts index 23761f2be8..207e5e13ce 100644 --- a/apps/web/src/app/vault/individual-vault/bulk-action-dialogs/bulk-delete-dialog/bulk-delete-dialog.component.ts +++ b/apps/web/src/app/vault/individual-vault/bulk-action-dialogs/bulk-delete-dialog/bulk-delete-dialog.component.ts @@ -3,7 +3,6 @@ import { Component, Inject } from "@angular/core"; import { ApiService } from "@bitwarden/common/abstractions/api.service"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; -import { CollectionBulkDeleteRequest } from "@bitwarden/common/models/request/collection-bulk-delete.request"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; @@ -127,8 +126,7 @@ export class BulkDeleteDialogComponent { ); return; } - const deleteRequest = new CollectionBulkDeleteRequest(this.collectionIds, this.organization.id); - return await this.apiService.deleteManyCollections(deleteRequest); + return await this.apiService.deleteManyCollections(this.organization.id, this.collectionIds); } private close(result: BulkDeleteDialogResult) { diff --git a/libs/common/src/abstractions/api.service.ts b/libs/common/src/abstractions/api.service.ts index c51ffd3d3c..a2bfda3c27 100644 --- a/libs/common/src/abstractions/api.service.ts +++ b/libs/common/src/abstractions/api.service.ts @@ -99,7 +99,6 @@ import { PlanResponse } from "../billing/models/response/plan.response"; import { SubscriptionResponse } from "../billing/models/response/subscription.response"; import { TaxInfoResponse } from "../billing/models/response/tax-info.response"; import { TaxRateResponse } from "../billing/models/response/tax-rate.response"; -import { CollectionBulkDeleteRequest } from "../models/request/collection-bulk-delete.request"; import { DeleteRecoverRequest } from "../models/request/delete-recover.request"; import { EventRequest } from "../models/request/event.request"; import { IapCheckRequest } from "../models/request/iap-check.request"; @@ -301,7 +300,7 @@ export abstract class ApiService { request: CollectionRequest ) => Promise; deleteCollection: (organizationId: string, id: string) => Promise; - deleteManyCollections: (request: CollectionBulkDeleteRequest) => Promise; + deleteManyCollections: (organizationId: string, collectionIds: string[]) => Promise; deleteCollectionUser: ( organizationId: string, id: string, diff --git a/libs/common/src/models/request/collection-bulk-delete.request.ts b/libs/common/src/models/request/collection-bulk-delete.request.ts index 142af44a43..3c4b5015f8 100644 --- a/libs/common/src/models/request/collection-bulk-delete.request.ts +++ b/libs/common/src/models/request/collection-bulk-delete.request.ts @@ -1,9 +1,7 @@ export class CollectionBulkDeleteRequest { ids: string[]; - organizationId: string; - constructor(ids: string[], organizationId?: string) { + constructor(ids: string[]) { this.ids = ids == null ? [] : ids; - this.organizationId = organizationId; } } diff --git a/libs/common/src/services/api.service.ts b/libs/common/src/services/api.service.ts index 9f658a0955..3139e84369 100644 --- a/libs/common/src/services/api.service.ts +++ b/libs/common/src/services/api.service.ts @@ -834,11 +834,11 @@ export class ApiService implements ApiServiceAbstraction { ); } - deleteManyCollections(request: CollectionBulkDeleteRequest): Promise { + deleteManyCollections(organizationId: string, collectionIds: string[]): Promise { return this.send( "DELETE", - "/organizations/" + request.organizationId + "/collections", - request, + "/organizations/" + organizationId + "/collections", + new CollectionBulkDeleteRequest(collectionIds), true, false );