Browse Source
Merge pull request #23328 from abpframework/issue/23327
Angular - Fixing the possible build errors on templates
pull/23352/head
Yağmur Çelik
7 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
12 additions and
4 deletions
-
npm/ng-packs/packages/core/src/lib/interceptors/api.interceptor.ts
-
npm/ng-packs/packages/oauth/src/lib/interceptors/api.interceptor.ts
|
|
|
@ -1,6 +1,13 @@ |
|
|
|
import { HttpHandler, HttpHeaders, HttpInterceptor, HttpRequest } from '@angular/common/http'; |
|
|
|
import { |
|
|
|
HttpHandler, |
|
|
|
HttpHeaders, |
|
|
|
HttpInterceptor, |
|
|
|
HttpRequest, |
|
|
|
HttpEvent, |
|
|
|
} from '@angular/common/http'; |
|
|
|
import { Injectable } from '@angular/core'; |
|
|
|
import { finalize } from 'rxjs/operators'; |
|
|
|
import { Observable } from 'rxjs'; |
|
|
|
import { HttpWaitService } from '../services'; |
|
|
|
|
|
|
|
@Injectable({ |
|
|
|
@ -13,7 +20,7 @@ export class ApiInterceptor implements IApiInterceptor { |
|
|
|
return existingHeaders || new HttpHeaders(); |
|
|
|
} |
|
|
|
|
|
|
|
intercept(request: HttpRequest<any>, next: HttpHandler) { |
|
|
|
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { |
|
|
|
this.httpWaitService.addRequest(request); |
|
|
|
return next.handle(request).pipe(finalize(() => this.httpWaitService.deleteRequest(request))); |
|
|
|
} |
|
|
|
|
|
|
|
@ -1,7 +1,8 @@ |
|
|
|
import { HttpHandler, HttpHeaders, HttpRequest } from '@angular/common/http'; |
|
|
|
import { HttpEvent, HttpHandler, HttpHeaders, HttpRequest } from '@angular/common/http'; |
|
|
|
import { Inject, Injectable } from '@angular/core'; |
|
|
|
import { OAuthService } from 'angular-oauth2-oidc'; |
|
|
|
import { finalize } from 'rxjs/operators'; |
|
|
|
import { Observable } from 'rxjs'; |
|
|
|
import { |
|
|
|
HttpWaitService, |
|
|
|
IApiInterceptor, |
|
|
|
@ -21,7 +22,7 @@ export class OAuthApiInterceptor implements IApiInterceptor { |
|
|
|
@Inject(TENANT_KEY) private tenantKey: string, |
|
|
|
) {} |
|
|
|
|
|
|
|
intercept(request: HttpRequest<any>, next: HttpHandler) { |
|
|
|
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { |
|
|
|
this.httpWaitService.addRequest(request); |
|
|
|
const isExternalRequest = request.context?.get(IS_EXTERNAL_REQUEST); |
|
|
|
const newRequest = isExternalRequest |
|
|
|
|