import { Component, Input, OnInit, AfterViewChecked, ViewChild } from '@angular/core'; import { HttpClient , HttpHeaders, HttpParams} from '@angular/common/http'; import { TokenService, TokenProvider } from './login/token.service' import 'rxjs/Rx'; import { Injectable } from '@angular/core'; import { Toolbox } from '../services/toolbox'; import {RestBase} from './rest-base'; @Injectable() export class DmpsServiceService implements OnInit { constructor(public restBase: RestBase, private toolbox : Toolbox) { } ngOnInit(){ } getDmpIdsLabels() { return this.restBase.get("dmp/listDMPLabelID"); } getDmpIds(){ return this.restBase.get("dmps"); } getAllDmps(){ return this.restBase.get("dmp/getAll"); } create(dmp){ var cloned = this.toolbox.deepCopy(dmp); cloned.project = {"id": dmp.project}; cloned.profile = {"id": dmp.profile}; return this.restBase.post("dmp/create", cloned); } delete(dmpID){ var dmp = {"id": dmpID}; return this.restBase.post("dmp/delete", dmp); } }