diff options
author | Danijel Anđelković <adanijel99@gmail.com> | 2022-05-20 04:02:03 +0200 |
---|---|---|
committer | Danijel Anđelković <adanijel99@gmail.com> | 2022-05-20 04:02:03 +0200 |
commit | 0d476fb3a73921bbea0994509bc95a19cebae70c (patch) | |
tree | a1f2071655b4bd2d78f46c7bb0424a08985664b8 /frontend/src/app/_services/datasets.service.ts | |
parent | 60d486a636230074350ac19900125098fd07f3f7 (diff) | |
parent | 9930bdb624f9511e9f4ead7abd435d25fbdcac4a (diff) |
Merge branch 'redesign' of http://gitlab.pmf.kg.ac.rs/igrannonica/neuronstellar
Diffstat (limited to 'frontend/src/app/_services/datasets.service.ts')
-rw-r--r-- | frontend/src/app/_services/datasets.service.ts | 21 |
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' }); + } } |