Skip to content

Commit acb052a

Browse files
committed
hotfix for the bug causing an instance to be deleted wether the dialog result was confirmed or cancle
1 parent 5018daa commit acb052a

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

client/src/app/dashboard/table-all/table-all.component.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,15 @@ export class TableAllComponent implements OnInit {
7777
console.log('data', this.dataSource.data);
7878

7979
} else {
80-
this.apiService.deleteInstance(id).subscribe((deleteResult: HttpEvent<number>) => {
81-
console.log('result', deleteResult);
82-
}, err => {
83-
console.log('error delete Instance');
84-
});
85-
this.removeAt(i);
86-
}
80+
if (result !== 'Cancle') {
81+
this.apiService.deleteInstance(id).subscribe((deleteResult: HttpEvent<number>) => {
82+
console.log('result', deleteResult);
83+
}, err => {
84+
console.log('error delete Instance');
85+
});
86+
this.removeAt(i);
87+
}
88+
}
8789
this.dialogResult = result;
8890
});
8991
}

0 commit comments

Comments
 (0)