diff --git a/connect/contentProviders/searchDataproviders.service.ts b/connect/contentProviders/searchDataproviders.service.ts index bce044d9..cbf7e76b 100644 --- a/connect/contentProviders/searchDataproviders.service.ts +++ b/connect/contentProviders/searchDataproviders.service.ts @@ -6,13 +6,13 @@ import {map} from "rxjs/operators"; @Injectable() export class SearchCommunityDataprovidersService { constructor(private http: HttpClient ) {} - searchDataproviders (properties:EnvProperties, communityId: string):any { - let url = properties.communityAPI+communityId+"/contentproviders"; + searchDataproviders (properties:EnvProperties, pid: string):any { + let url = properties.communityAPI+pid+"/contentproviders"; return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url); } - countTotalDataproviders(properties:EnvProperties,communityId:string) { - let url = properties.communityAPI+communityId+"/contentproviders"; + countTotalDataproviders(properties:EnvProperties,pid:string) { + let url = properties.communityAPI+pid+"/contentproviders"; return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url) .pipe(map(res => res['length'])); } diff --git a/connect/curators/curator.service.ts b/connect/curators/curator.service.ts index 1fb5fd4a..84a8a29d 100644 --- a/connect/curators/curator.service.ts +++ b/connect/curators/curator.service.ts @@ -16,11 +16,13 @@ export class CuratorService { return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url); } - public updateCurator(url: string, curator: Curator) { + public updateCurator(properties: EnvProperties, curator: Curator) { + let url: string = properties.adminToolsAPIURL + "curator"; return this.http.post(url, curator, CustomOptions.getAuthOptions()); } - public getCurator(properties: EnvProperties, url: string): Observable { + public getCurator(properties: EnvProperties, curatorId: string): Observable { + let url: string = properties.adminToolsAPIURL + 'curator/'+curatorId; return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url); } diff --git a/connect/projects/searchProjects.service.ts b/connect/projects/searchProjects.service.ts index 56e7f6a9..64c31cd0 100644 --- a/connect/projects/searchProjects.service.ts +++ b/connect/projects/searchProjects.service.ts @@ -8,14 +8,14 @@ import {map} from "rxjs/operators"; export class SearchCommunityProjectsService { constructor(private http: HttpClient ) {} - searchProjects (properties:EnvProperties, communityId: string):any { - let url = properties.communityAPI+communityId+"/projects"; + searchProjects (properties:EnvProperties, pid: string):any { + let url = properties.communityAPI+pid+"/projects"; return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url); //.map(res => res.json()) } - countTotalProjects(properties:EnvProperties,communityId:string) { - let url = properties.communityAPI+communityId+"/projects"; + countTotalProjects(properties:EnvProperties,pid:string) { + let url = properties.communityAPI+pid+"/projects"; return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url) .pipe(map(res => res['length'])); } diff --git a/connect/zenodoCommunities/searchZenodoCommunities.service.ts b/connect/zenodoCommunities/searchZenodoCommunities.service.ts index a70641ab..a8fccb47 100644 --- a/connect/zenodoCommunities/searchZenodoCommunities.service.ts +++ b/connect/zenodoCommunities/searchZenodoCommunities.service.ts @@ -7,8 +7,8 @@ import{EnvProperties} from '../../utils/properties/env-properties'; export class SearchZenodoCommunitiesService { constructor(private http: HttpClient ) {} - searchZCommunities (properties:EnvProperties, communityId: string):any { - let url = properties.communityAPI+communityId+"/zenodocommunities"; + searchZCommunities (properties:EnvProperties, pid: string):any { + let url = properties.communityAPI+pid+"/zenodocommunities"; return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url); //.map(res => res.json()) diff --git a/services/help-content.service.ts b/services/help-content.service.ts index f3dd7b13..07b9b6a2 100644 --- a/services/help-content.service.ts +++ b/services/help-content.service.ts @@ -393,4 +393,9 @@ export class HelpContentService { //.map(stats => stats.json()) .pipe(catchError(this.handleError)); } + + statisticsIsActiveToggle(apiURL: string, id: string): Observable { + const url = apiURL + '/statistics/' + encodeURIComponent(id) + '/toggle'; + return this.http.post(url, {}, CustomOptions.getAuthOptionsWithBody()).pipe(catchError(this.handleError)); + } } diff --git a/services/layout.service.ts b/services/layout.service.ts index aed31e90..e4088c65 100644 --- a/services/layout.service.ts +++ b/services/layout.service.ts @@ -21,14 +21,14 @@ export class LayoutService { } } - saveLayout(communityId: string, url: string, layout: CustomizationOptions): Observable { + saveLayout(properties: EnvProperties, pid: string, layout: CustomizationOptions): Observable { LayoutService.removeNulls(layout); - return this.http.post(url - + communityId + '/layout', layout, CustomOptions.getAuthOptionsWithBody()); + return this.http.post(properties.adminToolsAPIURL + 'community/' + + pid + '/layout', layout, CustomOptions.getAuthOptionsWithBody()); } - getLayout(properties: EnvProperties, communityId: string): Observable { - return this.http.get(properties.adminToolsAPIURL+"/community/" + communityId + '/layout'); + getLayout(properties: EnvProperties, pid: string): Observable { + return this.http.get(properties.adminToolsAPIURL+"/community/" + pid + '/layout'); } mockLayout(): any { diff --git a/utils/email/email.service.ts b/utils/email/email.service.ts index aebe6225..ea4ab62e 100644 --- a/utils/email/email.service.ts +++ b/utils/email/email.service.ts @@ -13,10 +13,10 @@ export class EmailService { constructor(private http:HttpClient) { } - notifyForNewManagers(properties: EnvProperties, communityId: string, email: Email) { + notifyForNewManagers(properties: EnvProperties, pid: string, email: Email) { let body = JSON.stringify(email); - return this.http.post(properties.adminToolsAPIURL + "/notifyForNewSubscribers/" + communityId, body, CustomOptions.getAuthOptionsWithBody()); + return this.http.post(properties.adminToolsAPIURL + "/notifyForNewSubscribers/" + pid, body, CustomOptions.getAuthOptionsWithBody()); //.map(request => request.json()); }