[develop | DONE | CHANGED] community home page: use method for grouped count queries
This commit is contained in:
parent
73b9a03d60
commit
1f29b3200f
|
@ -232,10 +232,7 @@ export class CommunityComponent {
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
this.countResearchResults("publication");
|
this.getCountResearchResults();
|
||||||
this.countResearchResults("dataset");
|
|
||||||
this.countResearchResults("software");
|
|
||||||
this.countResearchResults("other");
|
|
||||||
if(this.communityId == "enermaps"){
|
if(this.communityId == "enermaps"){
|
||||||
this.countResearchResults("dataset", "enermaps::selection" );
|
this.countResearchResults("dataset", "enermaps::selection" );
|
||||||
}
|
}
|
||||||
|
@ -389,6 +386,15 @@ export class CommunityComponent {
|
||||||
}
|
}
|
||||||
this.reloadFeaturedDatasets = false;
|
this.reloadFeaturedDatasets = false;
|
||||||
}
|
}
|
||||||
|
private getCountResearchResults(){
|
||||||
|
this.fetchPublications.searchUtils.status = this.errorCodes.LOADING;
|
||||||
|
this._searchResearchResultsService.countResults("communityid", this.communityId).subscribe(res =>{
|
||||||
|
this.fetchPublications.searchUtils.totalResults = res['publications'];
|
||||||
|
this.fetchDatasets.searchUtils.totalResults = res['datasets'];
|
||||||
|
this.fetchSoftware.searchUtils.totalResults = res['software'];
|
||||||
|
this.fetchOrps.searchUtils.totalResults = res['other'];
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
private countResearchResults(resultType: string, contextId = null) {
|
private countResearchResults(resultType: string, contextId = null) {
|
||||||
let fetch: FetchResearchResults;
|
let fetch: FetchResearchResults;
|
||||||
|
|
Loading…
Reference in New Issue