2018-11-21 10:34:39 +01:00
|
|
|
import {Injectable} from '@angular/core';
|
2019-06-03 15:20:36 +02:00
|
|
|
import {HttpClient} from "@angular/common/http";
|
2018-11-21 10:34:39 +01:00
|
|
|
import{EnvProperties} from '../../utils/properties/env-properties';
|
|
|
|
|
|
|
|
@Injectable()
|
|
|
|
export class SearchZenodoCommunitiesService {
|
2019-06-03 15:20:36 +02:00
|
|
|
constructor(private http: HttpClient ) {}
|
2018-11-21 10:34:39 +01:00
|
|
|
|
2020-04-08 13:25:41 +02:00
|
|
|
searchZCommunities (properties:EnvProperties, pid: string):any {
|
|
|
|
let url = properties.communityAPI+pid+"/zenodocommunities";
|
2018-11-21 10:34:39 +01:00
|
|
|
|
2019-06-03 15:20:36 +02:00
|
|
|
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url);
|
|
|
|
//.map(res => <any> res.json())
|
2018-11-21 10:34:39 +01:00
|
|
|
}
|
|
|
|
}
|