mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Remove deprecated use of getAlfrescoApi() #1094
remove getAlfrescoApi from auth #1094
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user