diff --git a/apps/web/src/app/vault/individual-vault/bulk-action-dialogs/bulk-delete-dialog/bulk-delete-dialog.component.html b/apps/web/src/app/vault/individual-vault/bulk-action-dialogs/bulk-delete-dialog/bulk-delete-dialog.component.html index 968bfa9515..f4248331ff 100644 --- a/apps/web/src/app/vault/individual-vault/bulk-action-dialogs/bulk-delete-dialog/bulk-delete-dialog.component.html +++ b/apps/web/src/app/vault/individual-vault/bulk-action-dialogs/bulk-delete-dialog/bulk-delete-dialog.component.html @@ -7,8 +7,8 @@ {{ "deleteSelectedItemsDesc" | i18n: cipherIds.length }} - - {{ "deleteSelectedCollectionsDesc" | i18n: collectionIds.length }} + + {{ "deleteSelectedCollectionsDesc" | i18n: collections.length }} {{ "deleteSelectedConfirmation" | i18n }} 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 38d4351872..83212a8785 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 @@ -15,7 +15,6 @@ import { DialogService } from "@bitwarden/components"; export interface BulkDeleteDialogParams { cipherIds?: string[]; - collectionIds?: string[]; permanent?: boolean; organization?: Organization; organizations?: Organization[]; @@ -47,7 +46,6 @@ export const openBulkDeleteDialog = ( }) export class BulkDeleteDialogComponent { cipherIds: string[]; - collectionIds: string[]; permanent = false; organization: Organization; organizations: Organization[]; @@ -64,7 +62,6 @@ export class BulkDeleteDialogComponent { private configService: ConfigServiceAbstraction, ) { this.cipherIds = params.cipherIds ?? []; - this.collectionIds = params.collectionIds ?? []; this.permanent = params.permanent; this.organization = params.organization; this.organizations = params.organizations; @@ -85,7 +82,7 @@ export class BulkDeleteDialogComponent { } } - if (this.collectionIds.length) { + if (this.collections.length) { deletePromises.push(this.deleteCollections()); } @@ -98,8 +95,8 @@ export class BulkDeleteDialogComponent { this.i18nService.t(this.permanent ? "permanentlyDeletedItems" : "deletedItems"), ); } - if (this.collectionIds.length) { - await this.collectionService.delete(this.collectionIds); + if (this.collections.length) { + await this.collectionService.delete(this.collections.map((c) => c.id)); this.platformUtilsService.showToast( "success", null, @@ -144,7 +141,10 @@ export class BulkDeleteDialogComponent { ); return; } - return await this.apiService.deleteManyCollections(this.organization.id, this.collectionIds); + return await this.apiService.deleteManyCollections( + this.organization.id, + this.collections.map((c) => c.id), + ); // From individual vault, so there can be multiple organizations } else if (this.organizations && this.collections) { const deletePromises: Promise[] = []; @@ -160,7 +160,7 @@ export class BulkDeleteDialogComponent { } const orgCollectionIds = orgCollections.map((c) => c.id); deletePromises.push( - this.apiService.deleteManyCollections(this.organization.id, orgCollectionIds), + this.apiService.deleteManyCollections(organization.id, orgCollectionIds), ); } return await Promise.all(deletePromises); diff --git a/apps/web/src/app/vault/individual-vault/vault.component.ts b/apps/web/src/app/vault/individual-vault/vault.component.ts index bf389fc7f7..964debb536 100644 --- a/apps/web/src/app/vault/individual-vault/vault.component.ts +++ b/apps/web/src/app/vault/individual-vault/vault.component.ts @@ -856,7 +856,6 @@ export class VaultComponent implements OnInit, OnDestroy { data: { permanent: this.filter.type === "trash", cipherIds: ciphers.map((c) => c.id), - collectionIds: collections.map((c) => c.id), organizations: organizations, collections: collections, }, diff --git a/apps/web/src/app/vault/org-vault/vault.component.ts b/apps/web/src/app/vault/org-vault/vault.component.ts index aa547da365..4dd05b67c1 100644 --- a/apps/web/src/app/vault/org-vault/vault.component.ts +++ b/apps/web/src/app/vault/org-vault/vault.component.ts @@ -816,7 +816,7 @@ export class VaultComponent implements OnInit, OnDestroy { data: { permanent: this.filter.type === "trash", cipherIds: ciphers.map((c) => c.id), - collectionIds: collections.map((c) => c.id), + collections: collections, organization, }, });