aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/app/_services/datasets.service.ts
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/app/_services/datasets.service.ts')
-rw-r--r--frontend/src/app/_services/datasets.service.ts21
1 files changed, 19 insertions, 2 deletions
diff --git a/frontend/src/app/_services/datasets.service.ts b/frontend/src/app/_services/datasets.service.ts
index 2211996f..2775613c 100644
--- a/frontend/src/app/_services/datasets.service.ts
+++ b/frontend/src/app/_services/datasets.service.ts
@@ -24,18 +24,35 @@ export class DatasetsService {
return this.http.post(`${Configuration.settings.apiURL}/dataset/add`, dataset, { headers: this.authService.authHeader() });
}
+ stealDataset(dataset: Dataset): Observable<any> {
+ return this.http.post(`${Configuration.settings.apiURL}/dataset/stealDs`, dataset, { headers: this.authService.authHeader() });
+ }
+
getDatasetFile(fileId: any): any {
return this.http.get(`${Configuration.settings.apiURL}/file/csvRead/${fileId}/-1/11`, { headers: this.authService.authHeader(), responseType: 'text' });
}
+ getDatasetFilePaging(fileId:any,begin:any,end:any){
+ return this.http.get(`${Configuration.settings.apiURL}/file/csvRead/${fileId}/${begin}/${end}`, { headers: this.authService.authHeader(), responseType: 'text' });
+ }
+ getDatasetHeader(fileId:any){
+ return this.http.get(`${Configuration.settings.apiURL}/file/csvRead/${fileId}/-1/1`, { headers: this.authService.authHeader(), responseType: 'text' });
+ }
getDatasetFilePartial(fileId: any, startRow: number, rowNum: number): Observable<any> {
return this.http.get(`${Configuration.settings.apiURL}/file/csvRead/${fileId}/${startRow}/${rowNum}`, { headers: this.authService.authHeader(), responseType: 'text' });
}
+ getDatasetById(datasetId: string): Observable<Dataset> {
+ return this.http.get<Dataset>(`${Configuration.settings.apiURL}/dataset/get/${datasetId}`, { headers: this.authService.authHeader() });
+ }
- editDataset(dataset: Dataset): Observable<Dataset> {
- return this.http.put<Dataset>(`${Configuration.settings.apiURL}/dataset/` + dataset._id, dataset, { headers: this.authService.authHeader() });
+ editDataset(dataset: Dataset){
+ return this.http.put(`${Configuration.settings.apiURL}/dataset/` + dataset._id, dataset, { headers: this.authService.authHeader() ,responseType:'text'});
}
deleteDataset(dataset: Dataset) {
return this.http.delete(`${Configuration.settings.apiURL}/dataset/` + dataset._id, { headers: this.authService.authHeader(), responseType: "text" });
}
+
+ downloadFile(id:string):Observable<Blob>{
+ return this.http.get(`${Configuration.settings.apiURL}/file/Download?id=`+id, { headers: this.authService.authHeader(), responseType: 'blob' });
+ }
}