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/datasets.service.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'frontend/src/app/_services/datasets.service.ts') diff --git a/frontend/src/app/_services/datasets.service.ts b/frontend/src/app/_services/datasets.service.ts index 9a718e7c..c3281be6 100644 --- a/frontend/src/app/_services/datasets.service.ts +++ b/frontend/src/app/_services/datasets.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 Dataset from '../_data/Dataset'; import { AuthService } from './auth.service'; @@ -13,26 +13,26 @@ export class DatasetsService { constructor(private http: HttpClient, private authService: AuthService) { } getPublicDatasets(): Observable { - return this.http.get(`${API_SETTINGS.apiURL}/dataset/publicdatasets`, { headers: this.authService.authHeader() }); + return this.http.get(`${Configuration.settings.apiURL}/dataset/publicdatasets`, { headers: this.authService.authHeader() }); } getMyDatasets(): Observable { - return this.http.get(`${API_SETTINGS.apiURL}/dataset/mydatasets`, { headers: this.authService.authHeader() }); + return this.http.get(`${Configuration.settings.apiURL}/dataset/mydatasets`, { headers: this.authService.authHeader() }); } addDataset(dataset: Dataset): Observable { - return this.http.post(`${API_SETTINGS.apiURL}/dataset/add`, dataset, { headers: this.authService.authHeader() }); + return this.http.post(`${Configuration.settings.apiURL}/dataset/add`, dataset, { headers: this.authService.authHeader() }); } getDatasetFile(fileId: any): any { - return this.http.get(`${API_SETTINGS.apiURL}/file/csvRead/true/${fileId}`, { headers: this.authService.authHeader(), responseType: 'text' }); + return this.http.get(`${Configuration.settings.apiURL}/file/csvRead/true/${fileId}`, { headers: this.authService.authHeader(), responseType: 'text' }); } editDataset(dataset: Dataset): Observable { - return this.http.put(`${API_SETTINGS.apiURL}/dataset/`, dataset, { headers: this.authService.authHeader() }); + return this.http.put(`${Configuration.settings.apiURL}/dataset/`, dataset, { headers: this.authService.authHeader() }); } deleteDataset(dataset: Dataset) { - return this.http.delete(`${API_SETTINGS.apiURL}/dataset/` + dataset.name, { headers: this.authService.authHeader(), responseType: "text" }); + return this.http.delete(`${Configuration.settings.apiURL}/dataset/` + dataset.name, { headers: this.authService.authHeader(), responseType: "text" }); } } -- cgit v1.2.3