use people api and new js api where possible (#5888)

* use people api and new js api where possible

* fix code and tests

* cleanup tests
This commit is contained in:
Denys Vuika
2020-08-12 13:45:48 +01:00
committed by GitHub
parent a0aaf0ea58
commit 4aa936bb9c
7 changed files with 119 additions and 135 deletions

View File

@@ -21,13 +21,6 @@ import { RolesService } from './roles.service';
import { Logger } from '../../utils/logger';
export class IdentityService {
api: ApiService;
constructor(api: ApiService) {
this.api = api;
}
ROLES = {
ACTIVITI_USER: 'ACTIVITI_USER',
ACTIVITI_ADMIN: 'ACTIVITI_ADMIN',
@@ -35,6 +28,8 @@ export class IdentityService {
ACTIVITI_IDENTITY: 'ACTIVITI_IDENTITY'
};
constructor(public api: ApiService) {}
async createIdentityUserWithRole(roles: string[]): Promise<any> {
const rolesService = new RolesService(this.api);
const user = await this.createIdentityUser();