]>
Commit | Line | Data |
---|---|---|
67ed6552 | 1 | import { Observable } from 'rxjs' |
5d79474c C |
2 | import { catchError } from 'rxjs/operators' |
3 | import { HttpClient } from '@angular/common/http' | |
4 | import { Injectable } from '@angular/core' | |
67ed6552 C |
5 | import { RestExtractor } from '@app/core' |
6 | import { Debug } from '@shared/models' | |
5d79474c | 7 | import { environment } from '../../../../environments/environment' |
5d79474c C |
8 | |
9 | @Injectable() | |
10 | export class DebugService { | |
11 | private static BASE_DEBUG_URL = environment.apiUrl + '/api/v1/server/debug' | |
12 | ||
13 | constructor ( | |
14 | private authHttp: HttpClient, | |
5d79474c C |
15 | private restExtractor: RestExtractor |
16 | ) {} | |
17 | ||
18 | getDebug (): Observable<Debug> { | |
19 | return this.authHttp.get<Debug>(DebugService.BASE_DEBUG_URL) | |
20 | .pipe( | |
21 | catchError(err => this.restExtractor.handleError(err)) | |
22 | ) | |
23 | } | |
24 | } |