diff --git a/src/app/community/community.component.ts b/src/app/community/community.component.ts index a4cc69c..6fe378f 100644 --- a/src/app/community/community.component.ts +++ b/src/app/community/community.component.ts @@ -232,10 +232,7 @@ export class CommunityComponent { } })); - this.countResearchResults("publication"); - this.countResearchResults("dataset"); - this.countResearchResults("software"); - this.countResearchResults("other"); + this.getCountResearchResults(); if(this.communityId == "enermaps"){ this.countResearchResults("dataset", "enermaps::selection" ); } @@ -389,6 +386,15 @@ export class CommunityComponent { } 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) { let fetch: FetchResearchResults;