aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/system/debug/debug.service.ts
blob: ab1d0a7fa06f3b3049fbea4a577a455bdfaf48a1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { Observable } from 'rxjs'
import { catchError } from 'rxjs/operators'
import { HttpClient } from '@angular/common/http'
import { Injectable } from '@angular/core'
import { RestExtractor } from '@app/core'
import { Debug } from '@shared/models'
import { environment } from '../../../../environments/environment'

@Injectable()
export class DebugService {
  private static BASE_DEBUG_URL = environment.apiUrl + '/api/v1/server/debug'

  constructor (
    private authHttp: HttpClient,
    private restExtractor: RestExtractor
  ) {}

  getDebug (): Observable<Debug> {
    return this.authHttp.get<Debug>(DebugService.BASE_DEBUG_URL)
               .pipe(
                 catchError(err => this.restExtractor.handleError(err))
               )
  }
}