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";
1313export abstract class Modal < C extends ClientAbstract , T extends ModelId > implements OnInit {
1414
1515 response ?: Message ;
16+ loading : boolean = false ;
1617
1718 @Input ( ) mode : Mode = Mode . Create ;
1819 @Input ( ) entity : T = this . newEntity ( ) ;
@@ -27,6 +28,8 @@ export abstract class Modal<C extends ClientAbstract, T extends ModelId> impleme
2728 return ;
2829 }
2930
31+ this . loading = true ;
32+
3033 const data = this . entity ;
3134
3235 try {
@@ -39,13 +42,16 @@ export abstract class Modal<C extends ClientAbstract, T extends ModelId> impleme
3942 response = await this . delete ( data ) ;
4043 }
4144
45+ this . loading = false ;
46+
4247 if ( response ) {
4348 this . modal . close ( {
4449 entity : data ,
4550 response : response . data ,
4651 } ) ;
4752 }
4853 } catch ( error ) {
54+ this . loading = false ;
4955 this . response = this . error . convert ( error ) ;
5056 }
5157 }
You can’t perform that action at this time.
0 commit comments