1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-10 05:13:29 +00:00

[PM-10324] Add bulk delete option for organization members (#11892)

* Refactor organization user API service to support bulk deletion of users

* Add copy for bulk user delete dialog

* Add bulk user delete dialog component

* Add bulk user delete functionality to members component

* Refactor members component to only display bulk user deletion option if the Account Deprovisioning flag is enabled

* Patch build process

* Revert "Patch build process"

This reverts commit 917c969f00.

---------

Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
This commit is contained in:
Rui Tomé
2024-11-14 15:49:16 +00:00
committed by GitHub
parent 642b8d2e6b
commit e6fce421f5
8 changed files with 213 additions and 0 deletions

View File

@@ -282,4 +282,15 @@ export abstract class OrganizationUserApiService {
* @param id - Organization user identifier
*/
abstract deleteOrganizationUser(organizationId: string, id: string): Promise<void>;
/**
* Delete many organization users
* @param organizationId - Identifier for the organization the users belongs to
* @param ids - List of organization user identifiers to delete
* @return List of user ids, including both those that were successfully deleted and those that had an error
*/
abstract deleteManyOrganizationUsers(
organizationId: string,
ids: string[],
): Promise<ListResponse<OrganizationUserBulkResponse>>;
}

View File

@@ -369,4 +369,18 @@ export class DefaultOrganizationUserApiService implements OrganizationUserApiSer
false,
);
}
async deleteManyOrganizationUsers(
organizationId: string,
ids: string[],
): Promise<ListResponse<OrganizationUserBulkResponse>> {
const r = await this.apiService.send(
"DELETE",
"/organizations/" + organizationId + "/users/delete-account",
new OrganizationUserBulkRequest(ids),
true,
true,
);
return new ListResponse(r, OrganizationUserBulkResponse);
}
}