1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 00:03:56 +00:00

[AC- 2493] Restore and Delete Unassigned Items (#8983)

* updates added for single and bulk delete and restore items including unassigned and permissions for owners and custom users
This commit is contained in:
Jason Ng
2024-05-21 12:32:02 -04:00
committed by GitHub
parent dff44b02e2
commit b7463d551c
6 changed files with 109 additions and 36 deletions

View File

@@ -1117,14 +1117,15 @@ export class CipherService implements CipherServiceAbstraction {
await this.restore({ id: id, revisionDate: response.revisionDate });
}
async restoreManyWithServer(
ids: string[],
organizationId: string = null,
asAdmin = false,
): Promise<void> {
/**
* 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[], orgId: string = null): Promise<void> {
let response;
if (asAdmin) {
const request = new CipherBulkRestoreRequest(ids, organizationId);
if (orgId) {
const request = new CipherBulkRestoreRequest(ids, orgId);
response = await this.apiService.putRestoreManyCiphersAdmin(request);
} else {
const request = new CipherBulkRestoreRequest(ids);