diff --git a/connect/projects/searchProjects.service.ts b/connect/projects/searchProjects.service.ts index 16715225..46da3044 100644 --- a/connect/projects/searchProjects.service.ts +++ b/connect/projects/searchProjects.service.ts @@ -10,11 +10,12 @@ export class SearchCommunityProjectsService { searchProjects (properties:EnvProperties, pid: string, page=1, size=500):any { this.searchProjectsWithPaging(properties,pid,page, size, null, null); } - searchProjectsWithPaging (properties:EnvProperties, pid: string, page=1, size=500, searchFilter, funder):any { + searchProjectsWithPaging (properties:EnvProperties, pid: string, page=1, size=500, searchFilter, funder, orderBy = "name"):any { let params = funder ? ["funder="+ funder] :[]; if (searchFilter) { params.push("searchFilter="+ searchFilter) } + params.push("orderBy="+ orderBy); let url = properties.communityAPI+pid+"/projects/"+ (page-1) + "/" + size + (params.length > 0?"?" + params.join("&"):""); return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url); } @@ -23,4 +24,8 @@ export class SearchCommunityProjectsService { return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url) .pipe(map(res => res['totalElements'])); } + getProjectFunders(properties:EnvProperties,pid:string) { + let url = properties.communityAPI+pid+"/funders"; + return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url); + } }