Display the num of minutes of flights

This commit is contained in:
Sébastien ANDRE
2024-01-02 13:34:09 +01:00
parent 42e18b92bd
commit 5caebc2e40
3 changed files with 18 additions and 6 deletions

View File

@@ -1,9 +1,10 @@
import { Injectable } from '@angular/core';
import { HttpEvent, HttpRequest, HttpResponse, HttpInterceptor, HttpHandler } from '@angular/common/http';
import { Observable } from 'rxjs/Observable';
// import { Observable } from 'rxjs/Observable';
// import 'rxjs/add/observable/of';
import { tap } from 'rxjs/operators';
import 'rxjs/add/observable/of';
import { Observable, of } from 'rxjs';
import { RequestCache } from '../services/request-cache.service';
@@ -13,7 +14,7 @@ export class CachingInterceptor implements HttpInterceptor {
intercept(req: HttpRequest<any>, next: HttpHandler) {
const cachedResponse = this.cache.get(req);
return cachedResponse ? Observable.of(cachedResponse) : this.sendRequest(req, next);
return cachedResponse ? of(cachedResponse) : this.sendRequest(req, next);
}
sendRequest(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {