Search stakeholders fix a bug with parsing results
This commit is contained in:
parent
fd3885d404
commit
5a64537d5c
|
@ -110,6 +110,13 @@ export class SearchStakeholdersComponent {
|
|||
});
|
||||
}
|
||||
|
||||
private parseResults(data: any) {
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
this.totalResults[i] = data[i];
|
||||
this.totalResults[i].isManager = this.isManager(data[i]);
|
||||
this.totalResults[i].isMember = this.isMember(data[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize stakeholders from Communities APIs
|
||||
|
@ -118,19 +125,13 @@ export class SearchStakeholdersComponent {
|
|||
*/
|
||||
private initFunders(params) {
|
||||
if(this.totalResults) {
|
||||
this.parseResults(this.totalResults);
|
||||
this._getResults(params);
|
||||
} else {
|
||||
this.totalResults = [];
|
||||
this.subscriptions.push(this._stakeholderService.getStakeholders(this.properties.monitorServiceAPIURL).subscribe(
|
||||
data => {
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
this.totalResults[i] = data[i];
|
||||
this.totalResults[i].isManager = this.isManager(data[i]);
|
||||
this.totalResults[i].isMember = this.isMember(data[i]);
|
||||
}
|
||||
this.totalResults = [];
|
||||
this.parseResults(data);
|
||||
this._getResults(params);
|
||||
},
|
||||
err => {
|
||||
|
|
Loading…
Reference in New Issue