diff --git a/dmp-frontend/src/app/dmps/editor/dmp-editor.component.html b/dmp-frontend/src/app/dmps/editor/dmp-editor.component.html
index b2af3ecb7..fcc41ff99 100644
--- a/dmp-frontend/src/app/dmps/editor/dmp-editor.component.html
+++ b/dmp-frontend/src/app/dmps/editor/dmp-editor.component.html
@@ -88,7 +88,7 @@
-
+
diff --git a/dmp-frontend/src/app/dmps/editor/dmp-editor.component.ts b/dmp-frontend/src/app/dmps/editor/dmp-editor.component.ts
index f095ae735..642b6ddc0 100644
--- a/dmp-frontend/src/app/dmps/editor/dmp-editor.component.ts
+++ b/dmp-frontend/src/app/dmps/editor/dmp-editor.component.ts
@@ -225,7 +225,7 @@ export class DataManagementPlanEditorComponent implements AfterViewInit {
});
}
- openConfirm(dmpLabel): void {
+ openConfirm(dmpLabel, id): void {
this._dialogService.openConfirm({
message: 'Are you sure you want to delete the "' + dmpLabel +'"',
disableClose: true || false, // defaults to false
@@ -236,7 +236,9 @@ export class DataManagementPlanEditorComponent implements AfterViewInit {
// width: '500px', //OPTIONAL, defaults to 400px
}).afterClosed().subscribe((accept: boolean) => {
if (accept) {
- // DO SOMETHING
+ this.dataManagementPlanService.delete(id).subscribe(()=>{
+ this.router.navigate(['/dmps'])
+ });
} else {
// DO SOMETHING ELSE
}
diff --git a/dmp-frontend/src/app/services/data-management-plan/data-management-plan.service.ts b/dmp-frontend/src/app/services/data-management-plan/data-management-plan.service.ts
index 2f6b7e96b..8eb65373f 100644
--- a/dmp-frontend/src/app/services/data-management-plan/data-management-plan.service.ts
+++ b/dmp-frontend/src/app/services/data-management-plan/data-management-plan.service.ts
@@ -52,4 +52,8 @@ export class DataManagementPlanService {
createDataManagementPlanClone(dataManagementPlanModel: DataManagementPlanModel, id:String): Observable {
return this.http.post(this.actionUrl + 'clone/' + id , dataManagementPlanModel, { headers: this.headers });
}
+
+ delete(id: String): Observable {
+ return this.http.delete(this.actionUrl + 'delete/' + id, { headers: this.headers });
+ }
}