blob: fadcdeae85c8e7d916bb336123b0d0f0f42d8006 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { API_SETTINGS } from 'src/config';
import Dataset from '../_data/Dataset';
import { AuthService } from './auth.service';
@Injectable({
providedIn: 'root'
})
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() });
}
addDataset(dataset:Dataset):any{
return this.http.post(`${API_SETTINGS.apiURL}/dataset/add`, dataset, { headers: this.authService.authHeader() });
}
}
|