2018-03-29 16:15:47 +02:00
|
|
|
import {Injectable} from '@angular/core';
|
2019-06-03 15:20:36 +02:00
|
|
|
import {HttpClient} from "@angular/common/http";
|
2019-06-05 15:33:18 +02:00
|
|
|
import {EnvProperties} from '../../utils/properties/env-properties';
|
|
|
|
import {map} from "rxjs/operators";
|
2018-03-29 16:15:47 +02:00
|
|
|
|
|
|
|
@Injectable()
|
2018-04-04 14:35:31 +02:00
|
|
|
export class SearchCommunityDataprovidersService {
|
2019-06-03 15:20:36 +02:00
|
|
|
constructor(private http: HttpClient ) {}
|
2020-04-08 13:25:41 +02:00
|
|
|
searchDataproviders (properties:EnvProperties, pid: string):any {
|
|
|
|
let url = properties.communityAPI+pid+"/contentproviders";
|
2018-03-29 16:15:47 +02:00
|
|
|
|
2019-06-03 15:20:36 +02:00
|
|
|
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url);
|
2019-06-05 15:33:18 +02:00
|
|
|
}
|
2020-04-08 13:25:41 +02:00
|
|
|
countTotalDataproviders(properties:EnvProperties,pid:string) {
|
|
|
|
let url = properties.communityAPI+pid+"/contentproviders";
|
2019-06-05 15:33:18 +02:00
|
|
|
return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
|
|
|
|
.pipe(map(res => res['length']));
|
2018-03-29 16:15:47 +02:00
|
|
|
}
|
|
|
|
}
|