argos/dmp-admin/src/app/services/datasets-service.service.ts

45 lines
964 B
TypeScript

import { Component, Input, OnInit, AfterViewChecked, ViewChild } from '@angular/core';
import { HttpClient,HttpParams } from '@angular/common/http';
import { TokenService, TokenProvider } from './login/token.service'
import 'rxjs/Rx';
import { Injectable } from '@angular/core';
import {RestBase} from './rest-base';
@Injectable()
export class DatasetsServiceService implements OnInit {
constructor(public restBase: RestBase) {
}
ngOnInit(){
}
getDatasetById(datasetID){
return this.restBase.get("datasets/"+datasetID);
}
fetchAllDatasets(){
return this.restBase.get("dataset/getAll");
}
setDataset(fullDataset){
return this.restBase.post("dataset/create", fullDataset);
}
deleteDataset(dataset){
return this.restBase.post("dataset/delete", dataset);
}
assignDMPToDataset(datasetID, dmpID){
return this.restBase.get("dataset/assignDMPToDataset" +"?datasetID="+datasetID+"&dmpID="+dmpID);
}
}