test refactoring

This commit is contained in:
Vito Albano
2016-10-13 01:29:23 +01:00
parent 90332daa64
commit c45b3878b7
7 changed files with 31 additions and 28 deletions

View File

@@ -38,7 +38,7 @@ export class BpmUserService {
*/
getCurrentUserInfo(): Observable<BpmUserModel> {
if ( this.authService.isBpmLoggedIn() ) {
return Observable.fromPromise(this.authService.getAlfrescoApi().activiti.profileApi.getProfilePicture())
return Observable.fromPromise(this.authService.getAlfrescoApi().activiti.profileApi.getProfile())
.map(
(data) => <BpmUserModel> data
)
@@ -48,7 +48,7 @@ export class BpmUserService {
getCurrentUserProfileImage(): Observable<any> {
if ( this.authService.isBpmLoggedIn() ) {
return Observable.fromPromise(this.authService.getAlfrescoApi().activiti.profileApi.getProfile())
return Observable.fromPromise(this.callGetProfilePictureApi())
.map(
(data) => data
)
@@ -56,6 +56,10 @@ export class BpmUserService {
}
}
callGetProfilePictureApi() {
return this.authService.getAlfrescoApi().activiti.profileApi.getProfilePicture();
}
/**
* Throw the error
* @param error