fix(console): delete provider, refactor add and update methods (#5515)

fix: provider deletion
This commit is contained in:
Max Peintner
2023-03-21 17:48:35 +01:00
committed by GitHub
parent a6c471b2e4
commit 9b41758af0
14 changed files with 425 additions and 840 deletions
@@ -142,31 +142,17 @@ export class IdpTableComponent implements OnInit {
dialogRef.afterClosed().subscribe((resp) => {
if (resp) {
if (this.serviceType === PolicyComponentServiceType.MGMT) {
(this.service as ManagementService).removeOrgIDP(idp.id).then(
() => {
this.toast.showInfo('IDP.TOAST.DELETED', true);
setTimeout(() => {
this.refreshPage();
}, 1000);
},
(error) => {
this.toast.showError(error);
},
);
} else {
(this.service as AdminService).removeIDP(idp.id).then(
() => {
this.toast.showInfo('IDP.TOAST.DELETED', true);
setTimeout(() => {
this.refreshPage();
}, 1000);
},
(error) => {
this.toast.showError(error);
},
);
}
this.service.deleteProvider(idp.id).then(
() => {
this.toast.showInfo('IDP.TOAST.DELETED', true);
setTimeout(() => {
this.refreshPage();
}, 1000);
},
(error) => {
this.toast.showError(error);
},
);
}
});
}