aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/app/_services/datasets.service.ts
diff options
context:
space:
mode:
authorDanijel Anđelković <adanijel99@gmail.com>2022-04-14 00:16:50 +0200
committerDanijel Anđelković <adanijel99@gmail.com>2022-04-14 00:16:50 +0200
commit8733ac0770aab10231b59d0398acd33765936247 (patch)
tree1d19233278ce9822c13f5482f96c5e52532fc1b7 /frontend/src/app/_services/datasets.service.ts
parent62939a4639c8bef9c520ac0a30613f16a65f4df1 (diff)
Dodao servis za citanje konfiguracije tako da moze da se promeni u buildovanoj angular aplikaciji.
Diffstat (limited to 'frontend/src/app/_services/datasets.service.ts')
-rw-r--r--frontend/src/app/_services/datasets.service.ts14
1 files changed, 7 insertions, 7 deletions
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<Dataset[]> {
- return this.http.get<Dataset[]>(`${API_SETTINGS.apiURL}/dataset/publicdatasets`, { headers: this.authService.authHeader() });
+ return this.http.get<Dataset[]>(`${Configuration.settings.apiURL}/dataset/publicdatasets`, { headers: this.authService.authHeader() });
}
getMyDatasets(): Observable<Dataset[]> {
- return this.http.get<Dataset[]>(`${API_SETTINGS.apiURL}/dataset/mydatasets`, { headers: this.authService.authHeader() });
+ return this.http.get<Dataset[]>(`${Configuration.settings.apiURL}/dataset/mydatasets`, { headers: this.authService.authHeader() });
}
addDataset(dataset: Dataset): Observable<any> {
- 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<Dataset> {
- return this.http.put<Dataset>(`${API_SETTINGS.apiURL}/dataset/`, dataset, { headers: this.authService.authHeader() });
+ return this.http.put<Dataset>(`${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" });
}
}