From 8733ac0770aab10231b59d0398acd33765936247 Mon Sep 17 00:00:00 2001 From: Danijel Anđelković Date: Thu, 14 Apr 2022 00:16:50 +0200 Subject: Dodao servis za citanje konfiguracije tako da moze da se promeni u buildovanoj angular aplikaciji. --- frontend/src/app/_services/user-info.service.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'frontend/src/app/_services/user-info.service.ts') diff --git a/frontend/src/app/_services/user-info.service.ts b/frontend/src/app/_services/user-info.service.ts index 16fc90a2..5d3394f6 100644 --- a/frontend/src/app/_services/user-info.service.ts +++ b/frontend/src/app/_services/user-info.service.ts @@ -1,7 +1,7 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; -import API_SETTINGS from '../../config.json'; +import { Configuration } from '../configuration.service'; import User from '../_data/User'; import { AuthService } from './auth.service'; @@ -13,18 +13,18 @@ export class UserInfoService { constructor(private http: HttpClient, private authService: AuthService) { } getUserInfo(): Observable { - return this.http.get(`${API_SETTINGS.apiURL}/user/myprofile`, { headers: this.authService.authHeader() }); + return this.http.get(`${Configuration.settings.apiURL}/user/myprofile`, { headers: this.authService.authHeader() }); } changeUserInfo(user: User): any { - return this.http.put(`${API_SETTINGS.apiURL}/user/changeinfo`, user, { headers: this.authService.authHeader() }); + return this.http.put(`${Configuration.settings.apiURL}/user/changeinfo`, user, { headers: this.authService.authHeader() }); } changeUserPassword(passwordArray: string[]): any { - return this.http.put(`${API_SETTINGS.apiURL}/user/changepass`, passwordArray, { headers: this.authService.authHeader(), responseType: 'text' }); + return this.http.put(`${Configuration.settings.apiURL}/user/changepass`, passwordArray, { headers: this.authService.authHeader(), responseType: 'text' }); } deleteUser(): any { - return this.http.delete(`${API_SETTINGS.apiURL}/user/deleteprofile`, { headers: this.authService.authHeader() }); + return this.http.delete(`${Configuration.settings.apiURL}/user/deleteprofile`, { headers: this.authService.authHeader() }); } } -- cgit v1.2.3