diff --git a/services/help-content.service.ts b/services/help-content.service.ts index f79bf1c9..53acd273 100644 --- a/services/help-content.service.ts +++ b/services/help-content.service.ts @@ -239,6 +239,12 @@ export class HelpContentService { // .pipe(catchError(this.handleError)); // } + getCommunityPagesByRoute(pid: string, route: string) { + return this.http.get>(properties.adminToolsAPIURL + properties.adminToolsPortalType + '/'+pid+'/pages' + + (route ? '?page_route='+route : '')) + .pipe(map(pages => (pages.length>0?pages[0]:null)), catchError(this.handleError)); + } + // Replacing getCommunityPages getCommunityPagesByType(pid: string, type: string) { return this.http.get>(properties.adminToolsAPIURL + properties.adminToolsPortalType + '/'+pid+'/pages' @@ -305,7 +311,7 @@ export class HelpContentService { .pipe(catchError(this.handleError)); } - togglePages(selectedPortalPid: string, ids : string[], status : boolean) { + togglePages(selectedPortalPid: string, ids : string[], status: boolean) { return this.http.post(properties.adminToolsAPIURL + properties.adminToolsPortalType + '/' + selectedPortalPid + '/page/toggle?status='+ status.toString(), JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody()) @@ -432,22 +438,21 @@ export class HelpContentService { .pipe(map(res => res['statistics'])); } - getCommunityAdminStatisticsChoices(apiUrl: string, portalId: string): Observable { - const url = `${apiUrl}statistics/${portalId}`; + getCommunityAdminStatisticsChoices(portalId: string): Observable { + const url = `${properties.adminToolsAPIURL}statistics/${portalId}`; //console.log(`getting admin choices for statistics from: ${url}`); return this.http.get(url) //.map(stats => stats.json()) .pipe(catchError(this.handleError)); } - postCommunityAdminStatisticsChoices(apiUrl: string, - portalId: string, + postCommunityAdminStatisticsChoices(portalId: string, entity: string, chartsOrNumbers: string, title: string, status: boolean, monitor: boolean): Observable { - const url = `${apiUrl}statistics/${portalId}/${entity}/${chartsOrNumbers}?status=${status.toString()}&monitor=${monitor.toString()}`; + const url = `${properties.adminToolsAPIURL}statistics/${portalId}/${entity}/${chartsOrNumbers}?status=${status.toString()}&monitor=${monitor.toString()}`; //console.log(`getting admin choices for statistics from: ${url}`); return this.http.post(url, title, CustomOptions.getAuthOptionsWithBody()) @@ -455,8 +460,8 @@ export class HelpContentService { .pipe(catchError(this.handleError)); } - statisticsIsActiveToggle(apiURL: string, id: string): Observable { - const url = apiURL + '/statistics/' + encodeURIComponent(id) + '/toggle'; + statisticsIsActiveToggle(id: string): Observable { + const url = properties.adminToolsAPIURL + 'statistics/' + encodeURIComponent(id) + '/toggle'; return this.http.post(url, {}, CustomOptions.getAuthOptionsWithBody()).pipe(catchError(this.handleError)); } }