Skip to content

Commit 271564b

Browse files
committed
add on submit callback
1 parent 5bed482 commit 271564b

File tree

1 file changed

+10
-0
lines changed
  • projects/fusio-sdk/src/lib/abstract

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ export abstract class Form<T> implements OnInit {
4747
async doCreate(entity: T) {
4848
try {
4949
this.response = await this.getService().create(entity);
50+
51+
this.onSubmit();
5052
} catch (error) {
5153
this.response = this.error.convert(error);
5254
}
@@ -55,6 +57,8 @@ export abstract class Form<T> implements OnInit {
5557
async doUpdate(entity: T) {
5658
try {
5759
this.response = await this.getService().update(entity);
60+
61+
this.onSubmit();
5862
} catch (error) {
5963
this.response = this.error.convert(error);
6064
}
@@ -63,6 +67,8 @@ export abstract class Form<T> implements OnInit {
6367
async doDelete(entity: T) {
6468
try {
6569
this.response = await this.getService().delete(entity);
70+
71+
this.onSubmit();
6672
} catch (error) {
6773
this.response = this.error.convert(error);
6874
}
@@ -78,6 +84,10 @@ export abstract class Form<T> implements OnInit {
7884
protected onLoad(): void
7985
{
8086
}
87+
88+
protected onSubmit(): void
89+
{
90+
}
8191
}
8292

8393
export enum Mode {

0 commit comments

Comments
 (0)