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