From 8b8c02eab9b1f9ecf21fe9d916341058a1ad495b Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Wed, 5 Jun 2019 14:21:38 +0000 Subject: [PATCH] [Trunk|Library]: Remove subject from curators service. git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@55998 d315682c-612b-4755-9ff5-7f18f6832af3 --- connect/curators/curator.service.ts | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/connect/curators/curator.service.ts b/connect/curators/curator.service.ts index 8efa8441..fc140f28 100644 --- a/connect/curators/curator.service.ts +++ b/connect/curators/curator.service.ts @@ -1,6 +1,6 @@ import {Injectable} from '@angular/core'; import {HttpClient} from '@angular/common/http'; -import {BehaviorSubject, Observable} from 'rxjs'; +import {Observable} from 'rxjs'; import {Curator} from '../../utils/entities/CuratorInfo'; import {EnvProperties} from '../../utils/properties/env-properties'; import {CustomOptions} from "../../services/servicesUtils/customOptions.class"; @@ -8,29 +8,11 @@ import {CustomOptions} from "../../services/servicesUtils/customOptions.class"; @Injectable() export class CuratorService { - private curatorsSubject: BehaviorSubject = new BehaviorSubject([]); - constructor(private http: HttpClient) { } - public initCurators(properties: EnvProperties, url: string): void { - this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url). - subscribe((curators) => { - this.curatorsSubject.next(curators); - }); - } - - public get curators(): Observable { - return this.curatorsSubject.asObservable(); - } - - public updateCurators(curator: Curator) { - const curators = this.curatorsSubject.value; - if (curators && curator) { - curator._id = null; - curators.push(curator); - this.curatorsSubject.next(curators); - } + public getCurators(properties: EnvProperties, url: string): Observable { + return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url); } public updateCurator(url: string, curator: Curator) {