From 82348a8a3b9a486a7174cfae34b06ddea7edfc1a Mon Sep 17 00:00:00 2001 From: argirok Date: Tue, 19 Sep 2023 15:59:37 +0300 Subject: [PATCH] update manage projects page to use paging and search through new communities API --- connect/projects/searchProjects.service.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/connect/projects/searchProjects.service.ts b/connect/projects/searchProjects.service.ts index 9ddd5996..16715225 100644 --- a/connect/projects/searchProjects.service.ts +++ b/connect/projects/searchProjects.service.ts @@ -7,11 +7,16 @@ import {map} from "rxjs/operators"; export class SearchCommunityProjectsService { constructor(private http: HttpClient ) {} - searchProjects (properties:EnvProperties, pid: string, page=0, size=500):any { - let url = properties.communityAPI+pid+"/projects/"+ page + "/" + size; - + 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 { + let params = funder ? ["funder="+ funder] :[]; + if (searchFilter) { + params.push("searchFilter="+ searchFilter) + } + 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); - //.map(res => res.json()) } countTotalProjects(properties:EnvProperties,pid:string) { let url = properties.communityAPI+pid+"/projects/0/1";