Skip to content

Commit 7ad0d65

Browse files
committed
use new entity only on create
1 parent 1566441 commit 7ad0d65

File tree

1 file changed

+3
-2
lines changed
  • projects/fusio-sdk/src/lib/abstract

1 file changed

+3
-2
lines changed

projects/fusio-sdk/src/lib/abstract/form.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ export abstract class Form<T> implements OnInit {
2020
}
2121

2222
async ngOnInit(): Promise<void> {
23-
this.entity = this.getService().newEntity();
24-
2523
this.route.data.subscribe((data) => {
2624
this.mode = data['mode'];
25+
if (this.mode === Mode.Create) {
26+
this.entity = this.getService().newEntity();
27+
}
2728
});
2829

2930
this.route.paramMap.subscribe(async params => {

0 commit comments

Comments
 (0)