mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
[AAE-12501] Replace oauth2Auth with alfrescoApi
This commit is contained in:
@@ -31,9 +31,7 @@ describe('AppsProcessCloudService', () => {
|
||||
let apiService: AlfrescoApiService;
|
||||
|
||||
const apiMock: any = {
|
||||
oauth2Auth: {
|
||||
callCustomApi: () => Promise.resolve({list : { entries: [ {entry: fakeApplicationInstance[0]}, {entry: fakeApplicationInstance[1]}] }})
|
||||
},
|
||||
callCustomApiWithoutAuth: () => Promise.resolve({list : { entries: [ {entry: fakeApplicationInstance[0]}, {entry: fakeApplicationInstance[1]}] }}),
|
||||
isEcmLoggedIn: () => false,
|
||||
reply: jasmine.createSpy('reply')
|
||||
};
|
||||
|
||||
@@ -19,7 +19,7 @@ import { Injectable } from '@angular/core';
|
||||
import { Observable, from, throwError, of } from 'rxjs';
|
||||
import { map, catchError } from 'rxjs/operators';
|
||||
import { AlfrescoApiService, AppConfigService, LogService } from '@alfresco/adf-core';
|
||||
import { Oauth2Auth } from '@alfresco/js-api';
|
||||
import { AlfrescoApi } from '@alfresco/js-api';
|
||||
import { ApplicationInstanceModel } from '../models/application-instance.model';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
@@ -62,7 +62,7 @@ export class AppsProcessCloudService {
|
||||
if (status === '') {
|
||||
return of([]);
|
||||
}
|
||||
const api: Oauth2Auth = this.apiService.getInstance().oauth2Auth;
|
||||
const api: AlfrescoApi = this.apiService.getInstance();
|
||||
const path = this.getApplicationUrl();
|
||||
const pathParams = {};
|
||||
const queryParams = { status, roles : role, sort: 'name' };
|
||||
@@ -72,7 +72,7 @@ export class AppsProcessCloudService {
|
||||
const contentTypes = ['application/json'];
|
||||
const accepts = ['application/json'];
|
||||
|
||||
return from(api.callCustomApi(path, 'GET', pathParams, queryParams, headerParams, formParams, bodyParam,
|
||||
return from(api.callCustomApiWithoutAuth(path, 'GET', pathParams, queryParams, headerParams, formParams, bodyParam,
|
||||
contentTypes, accepts))
|
||||
.pipe(
|
||||
map((applications: any) => applications.list.entries.map((application) => application.entry)),
|
||||
|
||||
Reference in New Issue
Block a user