mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-10-01 14:41:32 +00:00
feat: replace api usage for ContentApi
This commit is contained in:
@@ -19,9 +19,10 @@ import { Injectable } from '@angular/core';
|
||||
import {
|
||||
AlfrescoApiCompatibility,
|
||||
ContentApi,
|
||||
Node, NodesApi
|
||||
Node
|
||||
} from '@alfresco/js-api';
|
||||
import { ReplaySubject, Subject } from 'rxjs';
|
||||
import { ApiClientsService } from '../api/api-clients.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -36,7 +37,6 @@ export class ExternalAlfrescoApiService {
|
||||
alfrescoApiInitialized: ReplaySubject<boolean> = new ReplaySubject(1);
|
||||
|
||||
protected alfrescoApi: AlfrescoApiCompatibility;
|
||||
_nodesApi: NodesApi;
|
||||
|
||||
getInstance(): AlfrescoApiCompatibility {
|
||||
return this.alfrescoApi;
|
||||
@@ -46,11 +46,12 @@ export class ExternalAlfrescoApiService {
|
||||
return this.getInstance().content;
|
||||
}
|
||||
|
||||
get nodesApi(): NodesApi {
|
||||
this._nodesApi = this._nodesApi ?? new NodesApi(this.getInstance());
|
||||
return this._nodesApi;
|
||||
get nodesApi() {
|
||||
return this.apiClientsService.get('ContentClient.nodes');
|
||||
}
|
||||
|
||||
constructor(private apiClientsService: ApiClientsService) { }
|
||||
|
||||
init(ecmHost: string, contextRoot: string) {
|
||||
|
||||
const domainPrefix = this.createPrefixFromHost(ecmHost);
|
||||
|
Reference in New Issue
Block a user