Skip to content

Commit 64f0e9a

Browse files
committed
add loading property
1 parent 88358e6 commit 64f0e9a

File tree

1 file changed

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

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {ErrorService} from "../service/error.service";
1313
export 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
}

0 commit comments

Comments
 (0)