File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
projects/fusio-sdk/src/lib/abstract Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import {ErrorService} from "../service/error.service";
13
13
export abstract class Modal < C extends ClientAbstract , T extends ModelId > implements OnInit {
14
14
15
15
response ?: Message ;
16
+ loading : boolean = false ;
16
17
17
18
@Input ( ) mode : Mode = Mode . Create ;
18
19
@Input ( ) entity : T = this . newEntity ( ) ;
@@ -27,6 +28,8 @@ export abstract class Modal<C extends ClientAbstract, T extends ModelId> impleme
27
28
return ;
28
29
}
29
30
31
+ this . loading = true ;
32
+
30
33
const data = this . entity ;
31
34
32
35
try {
@@ -39,13 +42,16 @@ export abstract class Modal<C extends ClientAbstract, T extends ModelId> impleme
39
42
response = await this . delete ( data ) ;
40
43
}
41
44
45
+ this . loading = false ;
46
+
42
47
if ( response ) {
43
48
this . modal . close ( {
44
49
entity : data ,
45
50
response : response . data ,
46
51
} ) ;
47
52
}
48
53
} catch ( error ) {
54
+ this . loading = false ;
49
55
this . response = this . error . convert ( error ) ;
50
56
}
51
57
}
You can’t perform that action at this time.
0 commit comments