From 5e7d10b96b6f2e0011360517cd3cde1dfe6fd3f7 Mon Sep 17 00:00:00 2001 From: argirok Date: Wed, 4 Oct 2023 16:04:42 +0300 Subject: [PATCH] Community projects: add filtering and sorting --- connect/projects/searchProjects.service.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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); + } }