]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/+admin/system/debug/debug.service.ts
Fix client lint
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / system / debug / debug.service.ts
1 import { Observable } from 'rxjs'
2 import { catchError } from 'rxjs/operators'
3 import { HttpClient } from '@angular/common/http'
4 import { Injectable } from '@angular/core'
5 import { RestExtractor } from '@app/core'
6 import { Debug } from '@shared/models'
7 import { environment } from '../../../../environments/environment'
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,
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 }