Remove deprecated use of getAlfrescoApi() #1094

remove getAlfrescoApi from auth #1094
This commit is contained in:
Eugenio Romano
2016-11-28 14:04:58 +00:00
parent eed6902428
commit d87a768d20
18 changed files with 73 additions and 74 deletions

View File

@@ -18,10 +18,11 @@
import { Injectable } from '@angular/core';
import { Response } from '@angular/http';
import { Observable } from 'rxjs/Rx';
import { AlfrescoApi, NodePaging, MinimalNodeEntity } from 'alfresco-js-api';
import { NodePaging, MinimalNodeEntity } from 'alfresco-js-api';
import {
AlfrescoAuthenticationService,
AlfrescoContentService
AlfrescoContentService,
AlfrescoApiService
} from 'ng2-alfresco-core';
@Injectable()
@@ -58,11 +59,7 @@ export class DocumentListService {
'application/vnd.apple.numbers': 'ft_ic_spreadsheet.svg'
};
constructor(private authService: AlfrescoAuthenticationService, private contentService: AlfrescoContentService) {
}
private getAlfrescoApi(): AlfrescoApi {
return this.authService.getAlfrescoApi();
constructor(private authService: AlfrescoAuthenticationService, private contentService: AlfrescoContentService, private apiService: AlfrescoApiService) {
}
private getNodesPromise(folder: string, opts?: any): Promise<NodePaging> {
@@ -81,11 +78,11 @@ export class DocumentListService {
}
}
return this.getAlfrescoApi().nodes.getNodeChildren(nodeId, params);
return this.apiService.getInstance().nodes.getNodeChildren(nodeId, params);
}
deleteNode(nodeId: string): Observable<any> {
return Observable.fromPromise(this.getAlfrescoApi().nodes.deleteNode(nodeId));
return Observable.fromPromise(this.apiService.getInstance().nodes.deleteNode(nodeId));
}
/**