1 import { catchError } from 'rxjs/operators'
2 import { HttpClient } from '@angular/common/http'
3 import { Injectable } from '@angular/core'
4 import { CustomConfig } from '../../../../../../shared/models/server/custom-config.model'
5 import { environment } from '../../../../environments/environment'
6 import { RestExtractor } from '../../../shared'
9 export class ConfigService {
10 private static BASE_APPLICATION_URL = environment.apiUrl + '/api/v1/config'
13 private authHttp: HttpClient,
14 private restExtractor: RestExtractor
18 return this.authHttp.get<CustomConfig>(ConfigService.BASE_APPLICATION_URL + '/custom')
19 .pipe(catchError(res => this.restExtractor.handleError(res)))
22 updateCustomConfig (data: CustomConfig) {
23 return this.authHttp.put<CustomConfig>(ConfigService.BASE_APPLICATION_URL + '/custom', data)
24 .pipe(catchError(res => this.restExtractor.handleError(res)))