]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/+admin/config/shared/config.service.ts
Add messages about privacy concerns (P2P)
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / config / shared / config.service.ts
CommitLineData
fd206f0b
C
1import { HttpClient } from '@angular/common/http'
2import { Injectable } from '@angular/core'
3import { CustomConfig } from '../../../../../../shared/models/config/custom-config.model'
4import { environment } from '../../../../environments/environment'
5import { RestExtractor, RestService } from '../../../shared'
6
7@Injectable()
8export class ConfigService {
9 private static BASE_APPLICATION_URL = environment.apiUrl + '/api/v1/config'
10
11 constructor (
12 private authHttp: HttpClient,
13 private restService: RestService,
14 private restExtractor: RestExtractor
15 ) {}
16
17 getCustomConfig () {
18 return this.authHttp.get<CustomConfig>(ConfigService.BASE_APPLICATION_URL + '/custom')
19 .catch(res => this.restExtractor.handleError(res))
20 }
21
22 updateCustomConfig (data: CustomConfig) {
23 return this.authHttp.put<CustomConfig>(ConfigService.BASE_APPLICATION_URL + '/custom', data)
24 .catch(res => this.restExtractor.handleError(res))
25 }
26}