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 and call the custom api without using authentication
This commit is contained in:
@@ -18,7 +18,7 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
||||||
import { Observable, from } from 'rxjs';
|
import { Observable, from } from 'rxjs';
|
||||||
import { Oauth2Auth } from '@alfresco/js-api';
|
import { AlfrescoApi } from '@alfresco/js-api';
|
||||||
|
|
||||||
export const JSON_TYPE = ['application/json'];
|
export const JSON_TYPE = ['application/json'];
|
||||||
|
|
||||||
@@ -34,13 +34,13 @@ export interface OAuth2RequestParams {
|
|||||||
export class OAuth2Service {
|
export class OAuth2Service {
|
||||||
constructor(private alfrescoApiService: AlfrescoApiService) {}
|
constructor(private alfrescoApiService: AlfrescoApiService) {}
|
||||||
|
|
||||||
get apiClient(): Oauth2Auth {
|
get apiClient(): AlfrescoApi {
|
||||||
return this.alfrescoApiService.getInstance().oauth2Auth;
|
return this.alfrescoApiService.getInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
request<T>(opts: OAuth2RequestParams): Observable<T> {
|
request<T>(opts: OAuth2RequestParams): Observable<T> {
|
||||||
return from(
|
return from(
|
||||||
this.apiClient.callCustomApi(
|
this.apiClient.callCustomApiWithoutAuth(
|
||||||
opts.url,
|
opts.url,
|
||||||
opts.httpMethod,
|
opts.httpMethod,
|
||||||
opts.pathParams,
|
opts.pathParams,
|
||||||
|
|||||||
Reference in New Issue
Block a user