clone dmp

This commit is contained in:
annampak 2017-11-07 11:45:19 +02:00
parent 7ca2ff9eb4
commit ee71134a60
3 changed files with 18 additions and 1 deletions

View File

@ -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(){ SaveDmp(){
if (this.dmp.id == null) if (this.dmp.id == null)
this.newDMP(); this.newDMP();

View File

@ -183,7 +183,7 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary" (click)="SaveDmp();">Save Dmp</button> <button type="submit" class="btn btn-primary" (click)="cloneDMP(dmp);">Save Dmp</button>
</div> </div>
</div> </div>
</div> </div>

View File

@ -110,6 +110,10 @@ export class ServerService {
return this.restBase.post("dmp/update", data); return this.restBase.post("dmp/update", data);
} }
public cloneDmp(data: any){
return this.restBase.post("dmp/cloneforuser", data);
}
public deleteDmp(dmp: any){ public deleteDmp(dmp: any){
return this.restBase.post("dmp/softdelete", dmp); return this.restBase.post("dmp/softdelete", dmp);
} }