mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-10-24 23:05:29 +08:00
fix(plugin-authentication): users deletion
CB-234
This commit is contained in:
+2
-4
@@ -12,7 +12,7 @@ import { injectable } from '@cloudbeaver/core-di';
|
||||
import { CommonDialogService, ConfirmationDialog } from '@cloudbeaver/core-dialogs';
|
||||
import { NotificationService } from '@cloudbeaver/core-events';
|
||||
import { ErrorDetailsDialog } from '@cloudbeaver/core-notifications';
|
||||
import { GQLErrorCatcher } from '@cloudbeaver/core-sdk';
|
||||
import { GQLErrorCatcher, resourceKeyList } from '@cloudbeaver/core-sdk';
|
||||
|
||||
import { UsersResource } from '../UsersResource';
|
||||
|
||||
@@ -85,9 +85,7 @@ export class UsersAdministrationController {
|
||||
return;
|
||||
}
|
||||
|
||||
for (const userId of deletionList) {
|
||||
await this.usersResource.delete(userId);
|
||||
}
|
||||
await this.usersResource.delete(resourceKeyList(deletionList));
|
||||
this.selectedItems.clear();
|
||||
await this.usersResource.loadAll();
|
||||
} catch (exception) {
|
||||
|
||||
@@ -157,19 +157,19 @@ export class UsersResource extends CachedMapResource<string, AdminUserInfo> {
|
||||
if (this.isActiveUser(key.list[i])) {
|
||||
throw new Error('You can\'t delete current logged user');
|
||||
}
|
||||
this.data.delete(key.list[i]);
|
||||
if (!this.isNew(key.list[i])) {
|
||||
await this.graphQLService.gql.deleteUser({ userId: key.list[i] });
|
||||
}
|
||||
this.data.delete(key.list[i]);
|
||||
}
|
||||
} else {
|
||||
if (this.isActiveUser(key)) {
|
||||
throw new Error('You can\'t delete current logged user');
|
||||
}
|
||||
this.data.delete(key);
|
||||
if (!this.isNew(key)) {
|
||||
await this.graphQLService.gql.deleteUser({ userId: key });
|
||||
}
|
||||
this.data.delete(key);
|
||||
}
|
||||
this.markUpdated(key);
|
||||
this.itemDeleteSubject.next(key);
|
||||
|
||||
Reference in New Issue
Block a user