aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/core
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-06-17 11:28:11 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-06-17 11:28:11 +0200
commit154898b0b7bc1af41fc5a94974e338a3590c90f3 (patch)
tree5fb90f66da7587aed53c99ac1884c7acd0c1f7ca /client/src/app/core
parentdf98563e2104b82b119c00a3cd83cd0dc1242d25 (diff)
downloadPeerTube-154898b0b7bc1af41fc5a94974e338a3590c90f3.tar.gz
PeerTube-154898b0b7bc1af41fc5a94974e338a3590c90f3.tar.zst
PeerTube-154898b0b7bc1af41fc5a94974e338a3590c90f3.zip
Share models between server and client
Diffstat (limited to 'client/src/app/core')
-rw-r--r--client/src/app/core/auth/auth.service.ts5
-rw-r--r--client/src/app/core/config/config.service.ts7
2 files changed, 5 insertions, 7 deletions
diff --git a/client/src/app/core/auth/auth.service.ts b/client/src/app/core/auth/auth.service.ts
index 32f7a5503..fcc6b9bb6 100644
--- a/client/src/app/core/auth/auth.service.ts
+++ b/client/src/app/core/auth/auth.service.ts
@@ -11,6 +11,7 @@ import { NotificationsService } from 'angular2-notifications'
11 11
12import { AuthStatus } from './auth-status.model' 12import { AuthStatus } from './auth-status.model'
13import { AuthUser } from './auth-user.model' 13import { AuthUser } from './auth-user.model'
14import { ClientLocal } from '../../../../../shared'
14// Do not use the barrel (dependency loop) 15// Do not use the barrel (dependency loop)
15import { RestExtractor } from '../../shared/rest' 16import { RestExtractor } from '../../shared/rest'
16 17
@@ -40,9 +41,9 @@ export class AuthService {
40 // FIXME: save in local storage? 41 // FIXME: save in local storage?
41 this.http.get(AuthService.BASE_CLIENT_URL) 42 this.http.get(AuthService.BASE_CLIENT_URL)
42 .map(this.restExtractor.extractDataGet) 43 .map(this.restExtractor.extractDataGet)
43 .catch((res) => this.restExtractor.handleError(res)) 44 .catch(res => this.restExtractor.handleError(res))
44 .subscribe( 45 .subscribe(
45 result => { 46 (result: ClientLocal) => {
46 this.clientId = result.client_id 47 this.clientId = result.client_id
47 this.clientSecret = result.client_secret 48 this.clientSecret = result.client_secret
48 console.log('Client credentials loaded.') 49 console.log('Client credentials loaded.')
diff --git a/client/src/app/core/config/config.service.ts b/client/src/app/core/config/config.service.ts
index a83ec61d2..b8cb15e84 100644
--- a/client/src/app/core/config/config.service.ts
+++ b/client/src/app/core/config/config.service.ts
@@ -2,16 +2,13 @@ import { Injectable } from '@angular/core'
2import { Http } from '@angular/http' 2import { Http } from '@angular/http'
3 3
4import { RestExtractor } from '../../shared/rest' 4import { RestExtractor } from '../../shared/rest'
5import { ServerConfig } from '../../../../../shared'
5 6
6@Injectable() 7@Injectable()
7export class ConfigService { 8export class ConfigService {
8 private static BASE_CONFIG_URL = API_URL + '/api/v1/config/' 9 private static BASE_CONFIG_URL = API_URL + '/api/v1/config/'
9 10
10 private config: { 11 private config: ServerConfig = {
11 signup: {
12 enabled: boolean
13 }
14 } = {
15 signup: { 12 signup: {
16 enabled: false 13 enabled: false
17 } 14 }