[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
This commit is contained in:
parent
bc427b7e62
commit
52b34e317d
|
@ -1,8 +1,8 @@
|
||||||
import {Injectable} from '@angular/core';
|
import {Injectable} from '@angular/core';
|
||||||
import {HttpClient, HttpErrorResponse} from "@angular/common/http";
|
import {HttpClient, HttpErrorResponse} from '@angular/common/http';
|
||||||
import {throwError} from 'rxjs';
|
import {throwError} from 'rxjs';
|
||||||
import {CustomOptions} from './servicesUtils/customOptions.class';
|
import {CustomOptions} from './servicesUtils/customOptions.class';
|
||||||
import {catchError} from "rxjs/operators";
|
import {catchError} from 'rxjs/operators';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class LayoutService {
|
export class LayoutService {
|
||||||
|
@ -22,26 +22,22 @@ export class LayoutService {
|
||||||
|
|
||||||
saveLayout(pid: string, url: string, layout: any) {
|
saveLayout(pid: string, url: string, layout: any) {
|
||||||
LayoutService.removeNulls(layout);
|
LayoutService.removeNulls(layout);
|
||||||
return this.http.post(url + 'community/' + pid + '/updateLayout', JSON.stringify(layout), CustomOptions.getAuthOptionsWithBody())
|
return this.http.post(url + 'community/' + pid + '/layout', JSON.stringify(layout), CustomOptions.getAuthOptionsWithBody())
|
||||||
//.map(res => res.json())
|
|
||||||
.pipe(catchError(this.handleError));
|
.pipe(catchError(this.handleError));
|
||||||
}
|
}
|
||||||
|
|
||||||
getLayout(pid: string, url: string) {
|
getLayout(pid: string, url: string) {
|
||||||
return this.http.get(url + 'community/' + pid + '/layout')
|
return this.http.get(url + 'community/' + pid + '/layout')
|
||||||
//.map(res => res.json())
|
|
||||||
.pipe(catchError(this.handleError));
|
.pipe(catchError(this.handleError));
|
||||||
}
|
}
|
||||||
|
|
||||||
loadDefaultLayout(pid: string, url: string) {
|
loadDefaultLayout(pid: string, url: string) {
|
||||||
return this.http.post(url + 'community/' + pid + '/resetLayout', null, CustomOptions.getAuthOptionsWithBody())
|
return this.http.post(url + 'community/' + pid + '/resetLayout', null, CustomOptions.getAuthOptionsWithBody())
|
||||||
//.map(res => res.json())
|
|
||||||
.pipe(catchError(this.handleError));
|
.pipe(catchError(this.handleError));
|
||||||
}
|
}
|
||||||
mockLayout():any {
|
|
||||||
|
|
||||||
|
mockLayout(): any {
|
||||||
return this.http.get("./assets/customizationOptions.json") ;
|
return this.http.get('./assets/customizationOptions.json') ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue