From 63c4db6d71b98523753c51747e308682d9a2e8a0 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 11 Dec 2017 17:36:46 +0100 Subject: Move to angular cli --- client/src/app/core/auth/auth.service.ts | 10 ++++------ client/src/app/core/core.module.ts | 1 - client/src/app/core/server/server.service.ts | 6 +++--- 3 files changed, 7 insertions(+), 10 deletions(-) (limited to 'client/src/app/core') diff --git a/client/src/app/core/auth/auth.service.ts b/client/src/app/core/auth/auth.service.ts index e887dde1f..e2b8b6ba5 100644 --- a/client/src/app/core/auth/auth.service.ts +++ b/client/src/app/core/auth/auth.service.ts @@ -1,7 +1,6 @@ import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http' import { Injectable } from '@angular/core' import { Router } from '@angular/router' - import { NotificationsService } from 'angular2-notifications' import 'rxjs/add/observable/throw' import 'rxjs/add/operator/do' @@ -13,10 +12,9 @@ import { Subject } from 'rxjs/Subject' import { OAuthClientLocal, User as UserServerModel, UserRefreshToken, UserRole, VideoChannel } from '../../../../../shared' import { Account } from '../../../../../shared/models/accounts' import { UserLogin } from '../../../../../shared/models/users/user-login.model' -// Do not use the barrel (dependency loop) +import { environment } from '../../../environments/environment' import { RestExtractor } from '../../shared/rest' import { UserConstructorHash } from '../../shared/users/user.model' - import { AuthStatus } from './auth-status.model' import { AuthUser } from './auth-user.model' @@ -43,9 +41,9 @@ interface UserLoginWithUserInformation extends UserLogin { @Injectable() export class AuthService { - private static BASE_CLIENT_URL = API_URL + '/api/v1/oauth-clients/local' - private static BASE_TOKEN_URL = API_URL + '/api/v1/users/token' - private static BASE_USER_INFORMATION_URL = API_URL + '/api/v1/users/me' + private static BASE_CLIENT_URL = environment.apiUrl + '/api/v1/oauth-clients/local' + private static BASE_TOKEN_URL = environment.apiUrl + '/api/v1/users/token' + private static BASE_USER_INFORMATION_URL = environment.apiUrl + '/api/v1/users/me' loginChangedSource: Observable userInformationLoaded = new ReplaySubject(1) diff --git a/client/src/app/core/core.module.ts b/client/src/app/core/core.module.ts index 75262e6cf..a58fe6ebe 100644 --- a/client/src/app/core/core.module.ts +++ b/client/src/app/core/core.module.ts @@ -11,7 +11,6 @@ import { AuthService } from './auth' import { LoginGuard, UserRightGuard } from './routing' import { ServerService } from './server' import { ConfirmComponent, ConfirmService } from './confirm' -import { MenuComponent, MenuAdminComponent } from './menu' import { throwIfAlreadyLoaded } from './module-import-guard' @NgModule({ diff --git a/client/src/app/core/server/server.service.ts b/client/src/app/core/server/server.service.ts index 16e0595b6..a5be9e199 100644 --- a/client/src/app/core/server/server.service.ts +++ b/client/src/app/core/server/server.service.ts @@ -2,13 +2,13 @@ import { HttpClient } from '@angular/common/http' import { Injectable } from '@angular/core' import 'rxjs/add/operator/do' import { ReplaySubject } from 'rxjs/ReplaySubject' - import { ServerConfig } from '../../../../../shared' +import { environment } from '../../../environments/environment' @Injectable() export class ServerService { - private static BASE_CONFIG_URL = API_URL + '/api/v1/config/' - private static BASE_VIDEO_URL = API_URL + '/api/v1/videos/' + private static BASE_CONFIG_URL = environment.apiUrl + '/api/v1/config/' + private static BASE_VIDEO_URL = environment.apiUrl + '/api/v1/videos/' videoPrivaciesLoaded = new ReplaySubject(1) videoCategoriesLoaded = new ReplaySubject(1) -- cgit v1.2.3