From 52b34e317d40b1ebc89e94c213d761b387da4aa6 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Tue, 8 Oct 2019 10:56:04 +0000 Subject: [PATCH] [Library]: Fix layout service with new methods. git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@57307 d315682c-612b-4755-9ff5-7f18f6832af3 --- services/layout.service.ts | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/services/layout.service.ts b/services/layout.service.ts index a7f8d8ce..ea0a8d3c 100644 --- a/services/layout.service.ts +++ b/services/layout.service.ts @@ -1,8 +1,8 @@ import {Injectable} from '@angular/core'; -import {HttpClient, HttpErrorResponse} from "@angular/common/http"; +import {HttpClient, HttpErrorResponse} from '@angular/common/http'; import {throwError} from 'rxjs'; import {CustomOptions} from './servicesUtils/customOptions.class'; -import {catchError} from "rxjs/operators"; +import {catchError} from 'rxjs/operators'; @Injectable() export class LayoutService { @@ -22,26 +22,22 @@ export class LayoutService { saveLayout(pid: string, url: string, layout: any) { LayoutService.removeNulls(layout); - return this.http.post(url + 'community/' + pid + '/updateLayout', JSON.stringify(layout), CustomOptions.getAuthOptionsWithBody()) - //.map(res => res.json()) + return this.http.post(url + 'community/' + pid + '/layout', JSON.stringify(layout), CustomOptions.getAuthOptionsWithBody()) .pipe(catchError(this.handleError)); } getLayout(pid: string, url: string) { return this.http.get(url + 'community/' + pid + '/layout') - //.map(res => res.json()) .pipe(catchError(this.handleError)); } loadDefaultLayout(pid: string, url: string) { return this.http.post(url + 'community/' + pid + '/resetLayout', null, CustomOptions.getAuthOptionsWithBody()) - //.map(res => res.json()) .pipe(catchError(this.handleError)); } - mockLayout():any { - - return this.http.get("./assets/customizationOptions.json") ; + mockLayout(): any { + return this.http.get('./assets/customizationOptions.json') ; }