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 ) {}
|
2018-03-29 16:15:47 +02:00
|
|
|
searchDataproviders (properties:EnvProperties, communityId: string):any {
|
|
|
|
let url = properties.communityAPI+communityId+"/contentproviders";
|
|
|
|
|
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
|
|
|
}
|
|
|
|
countTotalDataproviders(properties:EnvProperties,communityId:string) {
|
|
|
|
let url = properties.communityAPI+communityId+"/contentproviders";
|
|
|
|
return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
|
|
|
|
.pipe(map(res => res['length']));
|
2018-03-29 16:15:47 +02:00
|
|
|
}
|
|
|
|
}
|