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:
@@ -25,7 +25,7 @@ declare let jasmine: any;
|
||||
describe('AlfrescoSearchService', () => {
|
||||
|
||||
let service: AlfrescoSearchService;
|
||||
let authenticationService: AlfrescoAuthenticationService;
|
||||
let apiService: AlfrescoApiService;
|
||||
let injector: ReflectiveInjector;
|
||||
|
||||
beforeEach(() => {
|
||||
@@ -36,8 +36,8 @@ describe('AlfrescoSearchService', () => {
|
||||
AlfrescoAuthenticationService
|
||||
]);
|
||||
service = injector.get(AlfrescoSearchService);
|
||||
authenticationService = injector.get(AlfrescoAuthenticationService);
|
||||
spyOn(authenticationService, 'getAlfrescoApi').and.returnValue(fakeApi);
|
||||
apiService = injector.get(AlfrescoApiService);
|
||||
spyOn(apiService, 'getInstance').and.returnValue(fakeApi);
|
||||
});
|
||||
|
||||
it('should call search API with no additional options', (done) => {
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
import { AlfrescoAuthenticationService } from 'ng2-alfresco-core';
|
||||
import { AlfrescoAuthenticationService, AlfrescoApiService } from 'ng2-alfresco-core';
|
||||
|
||||
/**
|
||||
* Internal service used by Document List component.
|
||||
@@ -25,7 +25,7 @@ import { AlfrescoAuthenticationService } from 'ng2-alfresco-core';
|
||||
@Injectable()
|
||||
export class AlfrescoSearchService {
|
||||
|
||||
constructor(private authService: AlfrescoAuthenticationService) {
|
||||
constructor(public authService: AlfrescoAuthenticationService, private apiService: AlfrescoApiService) {
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -42,7 +42,7 @@ export class AlfrescoSearchService {
|
||||
}
|
||||
|
||||
private getQueryNodesPromise(term: string, opts: SearchOptions) {
|
||||
return this.authService.getAlfrescoApi().core.queriesApi.findNodes(term, opts);
|
||||
return this.apiService.getInstance().core.queriesApi.findNodes(term, opts);
|
||||
}
|
||||
|
||||
private handleError(error: any): Observable<any> {
|
||||
|
Reference in New Issue
Block a user