File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " ngx-fusio-sdk" ,
3
- "version" : " 6.0.4 " ,
3
+ "version" : " 6.0.5 " ,
4
4
"description" : " SDK to integrate Fusio into an Angular app" ,
5
5
"keywords" : [
6
6
" Fusio" ,
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ export abstract class Form<T> implements OnInit {
47
47
48
48
async doCreate ( entity : T ) {
49
49
try {
50
- this . response = await this . getService ( ) . create ( entity ) ;
50
+ this . response = await this . getService ( ) . create ( this . beforeCreate ( entity ) ) ;
51
51
52
52
this . onSubmit ( ) ;
53
53
} catch ( error ) {
@@ -57,7 +57,7 @@ export abstract class Form<T> implements OnInit {
57
57
58
58
async doUpdate ( entity : T ) {
59
59
try {
60
- this . response = await this . getService ( ) . update ( entity ) ;
60
+ this . response = await this . getService ( ) . update ( this . beforeUpdate ( entity ) ) ;
61
61
62
62
this . onSubmit ( ) ;
63
63
} catch ( error ) {
@@ -67,7 +67,7 @@ export abstract class Form<T> implements OnInit {
67
67
68
68
async doDelete ( entity : T ) {
69
69
try {
70
- this . response = await this . getService ( ) . delete ( entity ) ;
70
+ this . response = await this . getService ( ) . delete ( this . beforeDelete ( entity ) ) ;
71
71
72
72
this . onSubmit ( ) ;
73
73
} catch ( error ) {
@@ -89,6 +89,21 @@ export abstract class Form<T> implements OnInit {
89
89
protected onSubmit ( ) : void
90
90
{
91
91
}
92
+
93
+ protected beforeCreate ( entity : T ) : T
94
+ {
95
+ return entity ;
96
+ }
97
+
98
+ protected beforeUpdate ( entity : T ) : T
99
+ {
100
+ return entity ;
101
+ }
102
+
103
+ protected beforeDelete ( entity : T ) : T
104
+ {
105
+ return entity ;
106
+ }
92
107
}
93
108
94
109
export enum Mode {
You can’t perform that action at this time.
0 commit comments