Fix params format for queryId

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@50979 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
sofia.baltzi 2018-02-28 16:04:49 +00:00
parent 611e8801b3
commit 8125c9ae0c
2 changed files with 11 additions and 9 deletions

View File

@ -76,11 +76,10 @@ export class CommunityComponent {
communityId => { communityId => {
this.communityId = communityId['communityId']; this.communityId = communityId['communityId'];
}); });
this._communityService.getCommunity('https://dev-openaire.d4science.org/openaire/community/'+this.communityId).subscribe ( this._communityService.getCommunity('https://dev-openaire.d4science.org/openaire/community/'+this.communityId).subscribe (
community => { community => {
this.community = community; this.community = community;
this.params = {community: encodeURIComponent(community.queryId)}; this.params = {community: encodeURIComponent('"'+community.queryId+'"')};
console.log(community); console.log(community);
}); });

View File

@ -14,15 +14,18 @@ export class CommunityService {
} }
getTotal(url: string) { getTotal(url: string) {
return this.http.get(url) return this.http.get(url).map(res => <any> res.json()).map(res => res.total).do(res => {console.log(res)});
.map(res => <any> res.json()).map(res => res.total).do(res => {console.log(res)});
} }
// getTotal()
// countTotal(url:string): any {
// countResults(url:string): string { let total;
//
// }
return total;
}
getResults(url: string) { getResults(url: string) {
return this.http.get(url).map(res => <any> res.json()).map(res => this.parseResults(res['results'])); return this.http.get(url).map(res => <any> res.json()).map(res => this.parseResults(res['results']));