1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-12 22:33:35 +00:00

[PM-11333] Rename deleteOrganizationUser to removeOrganizationUser in BaseMembersComponent, OrganizationUserService and related files

This commit is contained in:
Rui Tomé
2024-08-30 15:01:29 +01:00
committed by GitHub
parent 361f90a488
commit 4453a5c114
7 changed files with 17 additions and 17 deletions

View File

@@ -96,7 +96,7 @@ export abstract class BaseMembersComponent<UserView extends UserViewTypes> {
abstract edit(user: UserView): void; abstract edit(user: UserView): void;
abstract getUsers(): Promise<ListResponse<UserView> | UserView[]>; abstract getUsers(): Promise<ListResponse<UserView> | UserView[]>;
abstract deleteUser(id: string): Promise<void>; abstract removeUser(id: string): Promise<void>;
abstract reinviteUser(id: string): Promise<void>; abstract reinviteUser(id: string): Promise<void>;
abstract confirmUser(user: UserView, publicKey: Uint8Array): Promise<void>; abstract confirmUser(user: UserView, publicKey: Uint8Array): Promise<void>;
@@ -132,7 +132,7 @@ export abstract class BaseMembersComponent<UserView extends UserViewTypes> {
return false; return false;
} }
this.actionPromise = this.deleteUser(user.id); this.actionPromise = this.removeUser(user.id);
try { try {
await this.actionPromise; await this.actionPromise;
this.toastService.showToast({ this.toastService.showToast({

View File

@@ -45,7 +45,7 @@ export class BulkRemoveComponent {
submit = async () => { submit = async () => {
this.loading = true; this.loading = true;
try { try {
const response = await this.deleteUsers(); const response = await this.removeUsers();
response.data.forEach((entry) => { response.data.forEach((entry) => {
const error = entry.error !== "" ? entry.error : this.i18nService.t("bulkRemovedMessage"); const error = entry.error !== "" ? entry.error : this.i18nService.t("bulkRemovedMessage");
@@ -59,8 +59,8 @@ export class BulkRemoveComponent {
this.loading = false; this.loading = false;
}; };
protected async deleteUsers() { protected async removeUsers() {
return await this.organizationUserService.deleteManyOrganizationUsers( return await this.organizationUserService.removeManyOrganizationUsers(
this.organizationId, this.organizationId,
this.users.map((user) => user.id), this.users.map((user) => user.id),
); );

View File

@@ -487,7 +487,7 @@ export class MemberDialogComponent implements OnDestroy {
} }
} }
await this.organizationUserService.deleteOrganizationUser( await this.organizationUserService.removeOrganizationUser(
this.params.organizationId, this.params.organizationId,
this.params.organizationUserId, this.params.organizationUserId,
); );

View File

@@ -269,8 +269,8 @@ export class MembersComponent extends BaseMembersComponent<OrganizationUserView>
return collectionMap; return collectionMap;
} }
deleteUser(id: string): Promise<void> { removeUser(id: string): Promise<void> {
return this.organizationUserService.deleteOrganizationUser(this.organization.id, id); return this.organizationUserService.removeOrganizationUser(this.organization.id, id);
} }
revokeUser(id: string): Promise<void> { revokeUser(id: string): Promise<void> {

View File

@@ -190,7 +190,7 @@ export class MembersComponent extends BaseMembersComponent<ProviderUser> {
await this.apiService.postProviderUserConfirm(this.providerId, user.id, request); await this.apiService.postProviderUserConfirm(this.providerId, user.id, request);
} }
deleteUser = (id: string): Promise<void> => removeUser = (id: string): Promise<void> =>
this.apiService.deleteProviderUser(this.providerId, id); this.apiService.deleteProviderUser(this.providerId, id);
edit = async (user: ProviderUser | null): Promise<void> => { edit = async (user: ProviderUser | null): Promise<void> => {

View File

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

View File

@@ -274,7 +274,7 @@ export class OrganizationUserServiceImplementation implements OrganizationUserSe
); );
} }
deleteOrganizationUser(organizationId: string, id: string): Promise<any> { removeOrganizationUser(organizationId: string, id: string): Promise<any> {
return this.apiService.send( return this.apiService.send(
"DELETE", "DELETE",
"/organizations/" + organizationId + "/users/" + id, "/organizations/" + organizationId + "/users/" + id,
@@ -284,7 +284,7 @@ export class OrganizationUserServiceImplementation implements OrganizationUserSe
); );
} }
async deleteManyOrganizationUsers( async removeManyOrganizationUsers(
organizationId: string, organizationId: string,
ids: string[], ids: string[],
): Promise<ListResponse<OrganizationUserBulkResponse>> { ): Promise<ListResponse<OrganizationUserBulkResponse>> {