mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-] update library to use new js-api 3.0.0 (#4097)
This commit is contained in:
committed by
Eugenio Romano
parent
2acd1b4e26
commit
3ef7d3b7ea
@@ -16,13 +16,12 @@
|
||||
*/
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Response } from '@angular/http';
|
||||
import { Observable, from, throwError } from 'rxjs';
|
||||
import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
||||
import { LogService } from '../../services/log.service';
|
||||
import { BpmUserModel } from '../models/bpm-user.model';
|
||||
import { map, catchError } from 'rxjs/operators';
|
||||
import { UserRepresentation } from 'alfresco-js-api';
|
||||
import { UserRepresentation } from '@alfresco/js-api';
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -45,8 +44,8 @@ export class BpmUserService {
|
||||
getCurrentUserInfo(): Observable<BpmUserModel> {
|
||||
return from(this.apiService.getInstance().activiti.profileApi.getProfile())
|
||||
.pipe(
|
||||
map((data: UserRepresentation) => {
|
||||
return new BpmUserModel(data);
|
||||
map((userRepresentation: UserRepresentation) => {
|
||||
return new BpmUserModel(userRepresentation);
|
||||
}),
|
||||
catchError((err) => this.handleError(err))
|
||||
);
|
||||
@@ -64,7 +63,7 @@ export class BpmUserService {
|
||||
* Throw the error
|
||||
* @param error
|
||||
*/
|
||||
private handleError(error: Response) {
|
||||
private handleError(error: any) {
|
||||
// in a real world app, we may send the error to some remote logging infrastructure
|
||||
// instead of just logging it to the console
|
||||
this.logService.error(error);
|
||||
|
Reference in New Issue
Block a user