- profile storage fixes

This commit is contained in:
2018-05-29 19:27:21 -04:00
parent 64f53271cd
commit 54dd243ce4

View File

@@ -9,12 +9,12 @@ export class ProfileService {
fallback: string = 'assets/data/profiles.json'; fallback: string = 'assets/data/profiles.json';
epSubmitted: string = '/submitted'; epSubmitted: string = '/submitted';
epVerified: string = '/verified'; epVerified: string = '/verified';
idMap: any = { all: {}, submitted: {}, verified: {} }; idMap: any;
profiles: any; profiles: any;
constructor(private http: Http) { constructor(private http: Http) {
this.idMap = {}; this.idMap = { all: {}, submitted: {}, verified: {} };
this.profiles = null; this.profiles = null;
} }
@@ -53,6 +53,7 @@ export class ProfileService {
.map(res => res.json()) .map(res => res.json())
.subscribe( .subscribe(
data => { data => {
this.idMap =
this.profiles = this.profiles || {}; this.profiles = this.profiles || {};
this.profiles[type] = data; this.profiles[type] = data;
this.profiles[type].reduce((map, profile, i) => { this.profiles[type].reduce((map, profile, i) => {