aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/app/_services/predictors.service.ts
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/app/_services/predictors.service.ts')
-rw-r--r--frontend/src/app/_services/predictors.service.ts15
1 files changed, 6 insertions, 9 deletions
diff --git a/frontend/src/app/_services/predictors.service.ts b/frontend/src/app/_services/predictors.service.ts
index 909d1a49..9e8383aa 100644
--- a/frontend/src/app/_services/predictors.service.ts
+++ b/frontend/src/app/_services/predictors.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 Predictor from '../_data/Predictor';
import { Column } from '../_pages/predict/predict.component';
import { AuthService } from './auth.service';
@@ -10,27 +10,24 @@ import { AuthService } from './auth.service';
providedIn: 'root'
})
export class PredictorsService {
-
-
-
constructor(private http: HttpClient, private authService: AuthService) { }
getPublicPredictors(): Observable<Predictor[]> {
- return this.http.get<Predictor[]>(`${API_SETTINGS.apiURL}/predictor/publicpredictors`, { headers: this.authService.authHeader() });
+ return this.http.get<Predictor[]>(`${Configuration.settings.apiURL}/predictor/publicpredictors`, { headers: this.authService.authHeader() });
}
getPredictor(id: String): Observable<Predictor> {
- return this.http.get<Predictor>(`${API_SETTINGS.apiURL}/predictor/getpredictor/` + id, { headers: this.authService.authHeader() });
+ return this.http.get<Predictor>(`${Configuration.settings.apiURL}/predictor/getpredictor/` + id, { headers: this.authService.authHeader() });
}
usePredictor(predictor: Predictor, inputs: Column[]) {
- return this.http.post(`${API_SETTINGS.apiURL}/predictor/usepredictor/` + predictor._id, inputs, { headers: this.authService.authHeader() });
+ return this.http.post(`${Configuration.settings.apiURL}/predictor/usepredictor/` + predictor._id, inputs, { headers: this.authService.authHeader() });
}
deletePredictor(predictor: Predictor) {
- return this.http.delete(`${API_SETTINGS.apiURL}/predictor/` + predictor.name, { headers: this.authService.authHeader(), responseType: "text" });
+ return this.http.delete(`${Configuration.settings.apiURL}/predictor/` + predictor.name, { headers: this.authService.authHeader(), responseType: "text" });
}
getMyPredictors(): Observable<Predictor[]> {
- return this.http.get<Predictor[]>(`${API_SETTINGS.apiURL}/predictor/mypredictors`, { headers: this.authService.authHeader() });
+ return this.http.get<Predictor[]>(`${Configuration.settings.apiURL}/predictor/mypredictors`, { headers: this.authService.authHeader() });
}
}