Change total function in community service and component

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@50966 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
sofia.baltzi 2018-02-28 10:34:51 +00:00
parent 803dd44a68
commit f85c536b8a
2 changed files with 6 additions and 16 deletions

View File

@ -71,17 +71,17 @@ export class CommunityComponent {
});
this._communityService.getNumberOfPublications().subscribe(
this._communityService.getTotal('http://beta.services.openaire.eu:8480/search/rest/v2/api/publications/count?format=json&fq=communityid=egi').subscribe(
publicationTotal => {
this.publicationTotal = publicationTotal;
});
this._communityService.getNumberOfResearchData().subscribe(
this._communityService.getTotal('http://beta.services.openaire.eu:8480/search/rest/v2/api/datasets/count?format=json&fq=communityid=egi').subscribe(
researchDataTotal => {
this.researchDataTotal = researchDataTotal;
});
this._communityService.getNumberOfSoftware().subscribe(
this._communityService.getTotal('http://beta.services.openaire.eu:8480/search/rest/v2/api/software/count?format=json&fq=communityid=egi').subscribe(
softwareTotal => {
this.softwareTotal = softwareTotal;
});

View File

@ -13,19 +13,9 @@ export class CommunityService {
constructor(private http:Http) {
}
getNumberOfPublications() {
return this.http.get('http://beta.services.openaire.eu:8480/search/rest/v2/api/publications/count?format=json&fq=communityid=egi')
.map(res => <any> res.json()).map(res => res.total).do(res => {console.log(res)});
}
getNumberOfResearchData() {
return this.http.get('http://beta.services.openaire.eu:8480/search/rest/v2/api/datasets/count?format=json&fq=communityid=egi')
.map(res => <any> res.json()).map(res => res.total).do(res => {console.log(res)});
}
getNumberOfSoftware() {
return this.http.get('http://beta.services.openaire.eu:8480/search/rest/v2/api/software/count?format=json&fq=communityid=egi')
.map(res => <any> res.json()).map(res => res.total).do(res => {console.log(res)});
getTotal(url: string) {
return this.http.get(url)
.map(res => <any> res.json()).map(res => res.total).do(res => {console.log(res)});
}
getResults(url: string) {