mirror of
https://github.com/bitwarden/browser
synced 2025-12-06 00:13:28 +00:00
fix bulk restore for unassigned items (#15533)
This commit is contained in:
@@ -1068,6 +1068,7 @@ export class VaultComponent implements OnInit, OnDestroy {
|
||||
if (unassignedCiphers.length > 0 || editAccessCiphers.length > 0) {
|
||||
await this.cipherService.restoreManyWithServer(
|
||||
[...unassignedCiphers, ...editAccessCiphers],
|
||||
this.userId,
|
||||
this.organization.id,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1029,7 +1029,8 @@ export class VaultComponent implements OnInit, OnDestroy {
|
||||
return;
|
||||
}
|
||||
|
||||
await this.cipherService.restoreManyWithServer(selectedCipherIds);
|
||||
const activeUserId = await firstValueFrom(this.accountService.activeAccount$.pipe(getUserId));
|
||||
await this.cipherService.restoreManyWithServer(selectedCipherIds, activeUserId);
|
||||
this.toastService.showToast({
|
||||
variant: "success",
|
||||
title: null,
|
||||
|
||||
@@ -209,7 +209,7 @@ export abstract class CipherService implements UserKeyRotationDataProvider<Ciphe
|
||||
userId: UserId,
|
||||
): Promise<any>;
|
||||
abstract restoreWithServer(id: string, userId: UserId, asAdmin?: boolean): Promise<any>;
|
||||
abstract restoreManyWithServer(ids: string[], orgId?: string): Promise<void>;
|
||||
abstract restoreManyWithServer(ids: string[], userId: UserId, orgId?: string): Promise<void>;
|
||||
abstract getKeyForCipherKeyDecryption(cipher: Cipher, userId: UserId): Promise<any>;
|
||||
abstract setAddEditCipherInfo(value: AddEditCipherInfo, userId: UserId): Promise<void>;
|
||||
/**
|
||||
|
||||
@@ -1336,7 +1336,7 @@ export class CipherService implements CipherServiceAbstraction {
|
||||
* No longer using an asAdmin Param. Org Vault bulkRestore will assess if an item is unassigned or editable
|
||||
* The Org Vault will pass those ids an array as well as the orgId when calling bulkRestore
|
||||
*/
|
||||
async restoreManyWithServer(ids: string[], userId: UserId, orgId: string = null): Promise<void> {
|
||||
async restoreManyWithServer(ids: string[], userId: UserId, orgId?: string): Promise<void> {
|
||||
let response;
|
||||
|
||||
if (orgId) {
|
||||
|
||||
Reference in New Issue
Block a user