diff --git a/dmp-frontend/src/app/dmps/dmp.component.ts b/dmp-frontend/src/app/dmps/dmp.component.ts index 70a21ceb3..fb8ce823d 100644 --- a/dmp-frontend/src/app/dmps/dmp.component.ts +++ b/dmp-frontend/src/app/dmps/dmp.component.ts @@ -158,6 +158,19 @@ updateDMP(){ } +cloneDMP(dmp){ + dmp = {"id": dmp.id}; + this.serverService.cloneDmp(dmp).subscribe( + response => { + this.getDmps(); + }, + error => { + console.log("Failed to clone dmp"); + } + ); + $("#newVersionDmpModal").modal("hide"); +} + SaveDmp(){ if (this.dmp.id == null) this.newDMP(); diff --git a/dmp-frontend/src/app/dmps/dmps.html b/dmp-frontend/src/app/dmps/dmps.html index 8ce22102f..8fe9db113 100644 --- a/dmp-frontend/src/app/dmps/dmps.html +++ b/dmp-frontend/src/app/dmps/dmps.html @@ -183,7 +183,7 @@ diff --git a/dmp-frontend/src/app/services/server.service.ts b/dmp-frontend/src/app/services/server.service.ts index 6b7c42738..008ca71c5 100644 --- a/dmp-frontend/src/app/services/server.service.ts +++ b/dmp-frontend/src/app/services/server.service.ts @@ -110,6 +110,10 @@ export class ServerService { return this.restBase.post("dmp/update", data); } + public cloneDmp(data: any){ + return this.restBase.post("dmp/cloneforuser", data); + } + public deleteDmp(dmp: any){ return this.restBase.post("dmp/softdelete", dmp); }