Skip to content
Snippets Groups Projects
Commit 49cc659e authored by paf's avatar paf
Browse files

Remove @SkipSelf in TestControllers's Services, because it works only without...

Remove @SkipSelf in TestControllers's Services, because it works only without (for what reason ever).
parent f67390d6
No related branches found
No related tags found
No related merge requests found
Pipeline #22099 failed
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 { HttpClient, HttpParams } from '@angular/common/http';
import { Observable, of, Subscription } from 'rxjs'; import { Observable, of, Subscription } from 'rxjs';
import { catchError, map, switchMap } from 'rxjs/operators'; import { catchError, map, switchMap } from 'rxjs/operators';
...@@ -16,8 +17,9 @@ import { ApiError } from '../app.interfaces'; ...@@ -16,8 +17,9 @@ import { ApiError } from '../app.interfaces';
export class BackendService { export class BackendService {
constructor( constructor(
@Inject('SERVER_URL') private serverUrl: string, @Inject('SERVER_URL') private serverUrl: string,
@SkipSelf() private http: HttpClient private http: HttpClient
) { } ) {
}
saveUnitReview(testId: string, unitName: string, priority: number, categories: string, entry: string) saveUnitReview(testId: string, unitName: string, priority: number, categories: string, entry: string)
: Observable<boolean> { : Observable<boolean> {
...@@ -66,7 +68,8 @@ export class BackendService { ...@@ -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 return this.http
.get( .get(
`${this.serverUrl}test/${testId}/resource/${resId}`, `${this.serverUrl}test/${testId}/resource/${resId}`,
...@@ -110,9 +113,9 @@ export class BackendService { ...@@ -110,9 +113,9 @@ export class BackendService {
notifyDyingTest(testId: string): void { notifyDyingTest(testId: string): void {
if (navigator.sendBeacon) { if (navigator.sendBeacon) {
navigator.sendBeacon(this.serverUrl + `test/${testId}/connection-lost`); navigator.sendBeacon(`${this.serverUrl}test/${testId}/connection-lost`);
} else { } else {
fetch(this.serverUrl + `test/${testId}/connection-lost`, { fetch(`${this.serverUrl}test/${testId}/connection-lost`, {
keepalive: true, keepalive: true,
method: 'POST' method: 'POST'
}); });
......
...@@ -44,7 +44,7 @@ export class CommandService extends WebsocketBackendService<Command[]> implement ...@@ -44,7 +44,7 @@ export class CommandService extends WebsocketBackendService<Command[]> implement
@Inject('IS_PRODUCTION_MODE') public isProductionMode: boolean, @Inject('IS_PRODUCTION_MODE') public isProductionMode: boolean,
private tcs: TestControllerService, private tcs: TestControllerService,
@Inject('SERVER_URL') serverUrl: string, @Inject('SERVER_URL') serverUrl: string,
@SkipSelf() protected http: HttpClient protected http: HttpClient
) { ) {
super(serverUrl, http); super(serverUrl, http);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment