diff --git a/src/app/test-controller/backend.service.ts b/src/app/test-controller/backend.service.ts index 7515a60d43e35cd732a00ce6f1cbd5b9c6f22f14..dc91c1ada8039b16222a74ee565e43ee52ab5b6c 100644 --- a/src/app/test-controller/backend.service.ts +++ b/src/app/test-controller/backend.service.ts @@ -1,4 +1,5 @@ -import { Injectable, Inject, SkipSelf } from '@angular/core'; +/* eslint-disable no-console */ +import { Injectable, Inject } from '@angular/core'; import { HttpClient, HttpParams } from '@angular/common/http'; import { Observable, of, Subscription } from 'rxjs'; import { catchError, map, switchMap } from 'rxjs/operators'; @@ -16,8 +17,9 @@ import { ApiError } from '../app.interfaces'; export class BackendService { constructor( @Inject('SERVER_URL') private serverUrl: string, - @SkipSelf() private http: HttpClient - ) { } + private http: HttpClient + ) { + } saveUnitReview(testId: string, unitName: string, priority: number, categories: string, entry: string) : Observable<boolean> { @@ -66,7 +68,8 @@ export class BackendService { ); } - getResource(testId: string, internalKey: string, resId: string, versionning = false): Observable<TaggedString | number> { + getResource(testId: string, internalKey: string, resId: string, + versionning = false): Observable<TaggedString | number> { return this.http .get( `${this.serverUrl}test/${testId}/resource/${resId}`, @@ -110,9 +113,9 @@ export class BackendService { notifyDyingTest(testId: string): void { if (navigator.sendBeacon) { - navigator.sendBeacon(this.serverUrl + `test/${testId}/connection-lost`); + navigator.sendBeacon(`${this.serverUrl}test/${testId}/connection-lost`); } else { - fetch(this.serverUrl + `test/${testId}/connection-lost`, { + fetch(`${this.serverUrl}test/${testId}/connection-lost`, { keepalive: true, method: 'POST' }); diff --git a/src/app/test-controller/command.service.ts b/src/app/test-controller/command.service.ts index f212ccb0d86d7b85fd9107ed7d9ffdbbdf5ff7b0..05e3fe48ad3cd5ffba4f47511e2e2f65947ea56e 100644 --- a/src/app/test-controller/command.service.ts +++ b/src/app/test-controller/command.service.ts @@ -44,7 +44,7 @@ export class CommandService extends WebsocketBackendService<Command[]> implement @Inject('IS_PRODUCTION_MODE') public isProductionMode: boolean, private tcs: TestControllerService, @Inject('SERVER_URL') serverUrl: string, - @SkipSelf() protected http: HttpClient + protected http: HttpClient ) { super(serverUrl, http);