Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Commit

Permalink
Use /api/users endpoint instead of /api/identities for fetching list …
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeykazakov committed Feb 9, 2017
1 parent eec80e5 commit 0f43de9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/app/user/user.service.ts
Expand Up @@ -15,7 +15,7 @@ import { User } from '../models/user';
export class UserService {
private headers = new Headers({'Content-Type': 'application/json'});
private userUrl = process.env.API_URL + 'user'; // URL to web api
private identitiesUrl = process.env.API_URL + 'identities'; // URL to web api
private usersUrl = process.env.API_URL + 'users'; // URL to web api
userData: User = {} as User;
allUserData: User[] = [];

Expand All @@ -30,7 +30,7 @@ export class UserService {
} else {
logger.log('UserService running in production mode.');
}
logger.log('UserService using user url ' + this.userUrl + ' identity url ' + this.identitiesUrl);
logger.log('UserService using user url ' + this.userUrl + ' users url ' + this.usersUrl);

this.broadcaster.on<string>('logout')
.subscribe(message => {
Expand Down Expand Up @@ -58,7 +58,7 @@ export class UserService {
.toPromise()
.then(response => {
let userData = response.json().data as User;
// The reference of this.userData is
// The reference of this.userData is
// being used in Header
// So updating the value like that
this.userData.attributes = {
Expand All @@ -79,10 +79,10 @@ export class UserService {
});
} else {
return this.http
.get(this.identitiesUrl, {headers: this.headers})
.get(this.usersUrl, {headers: this.headers})
.toPromise()
.then(response => {
this.allUserData = response.json().data as User[];
this.allUserData = response.json().data as User[];
return this.allUserData;
})
.catch(this.handleError);
Expand Down

0 comments on commit 0f43de9

Please sign in to comment.