mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 16:23:44 +00:00
Refactor organization user API service to support bulk deletion of users
This commit is contained in:
@@ -282,4 +282,15 @@ export abstract class OrganizationUserApiService {
|
|||||||
* @param id - Organization user identifier
|
* @param id - Organization user identifier
|
||||||
*/
|
*/
|
||||||
abstract deleteOrganizationUser(organizationId: string, id: string): Promise<void>;
|
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>>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -369,4 +369,18 @@ export class DefaultOrganizationUserApiService implements OrganizationUserApiSer
|
|||||||
false,
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user