This repository was archived by the owner on Apr 20, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathuser-api.service.ts
More file actions
42 lines (33 loc) · 1.38 KB
/
user-api.service.ts
File metadata and controls
42 lines (33 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { Injectable, Injector } from '@angular/core';
import { Restangular } from 'ngx-restangular';
import { MicroserviceConfig, microserviceRestangularFactory } from '../providers/microservice.provider';
import { AppState } from '../../app.service';
import { AuthService } from '../modules/auth/auth.service';
import { DsBaseEntityApiService } from './base-entity-api.service';
import 'rxjs/Rx';
/**
* The User API Service is a shared service for communication with the Authentication microservice.
*/
@Injectable()
export class UserApiService extends DsBaseEntityApiService<any> {
constructor(public restangular: Restangular,
protected injector: Injector,
protected appState: AppState,
protected auth: AuthService) {
super(restangular, injector);
let msConfig = new MicroserviceConfig();
msConfig.name = 'authentication';
msConfig.settings = this.appState.get('microservices')[msConfig.name];
this.restangular = microserviceRestangularFactory(restangular, auth, msConfig);
}
/**
* Fetch user account(s) by Identity UUID
* @param identityUuid The UUID of the identity associated with the user(s)
*/
loadUsersByIdentity(identityUuid: string): any {
let params = {
'identityUuid': identityUuid
};
return this.resource('users').getList(params);
}
}