update manage projects page to use paging and search through new communities API
This commit is contained in:
parent
116ead698b
commit
82348a8a3b
|
@ -7,11 +7,16 @@ import {map} from "rxjs/operators";
|
||||||
export class SearchCommunityProjectsService {
|
export class SearchCommunityProjectsService {
|
||||||
constructor(private http: HttpClient ) {}
|
constructor(private http: HttpClient ) {}
|
||||||
|
|
||||||
searchProjects (properties:EnvProperties, pid: string, page=0, size=500):any {
|
searchProjects (properties:EnvProperties, pid: string, page=1, size=500):any {
|
||||||
let url = properties.communityAPI+pid+"/projects/"+ page + "/" + size;
|
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);
|
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url);
|
||||||
//.map(res => <any> res.json())
|
|
||||||
}
|
}
|
||||||
countTotalProjects(properties:EnvProperties,pid:string) {
|
countTotalProjects(properties:EnvProperties,pid:string) {
|
||||||
let url = properties.communityAPI+pid+"/projects/0/1";
|
let url = properties.communityAPI+pid+"/projects/0/1";
|
||||||
|
|
Loading…
Reference in New Issue