feat: add new standalone components for system and organization management modules
This commit is contained in:
@@ -11,6 +11,7 @@ import { UntypedFormBuilder, UntypedFormGroup, Validators, ReactiveFormsModule }
|
||||
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
|
||||
import { OrganizationService } from 'app/organization/organization.service';
|
||||
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
|
||||
import { AlertService } from 'app/core/alert/alert.service';
|
||||
|
||||
@Component({
|
||||
selector: 'mifosx-create-fund',
|
||||
@@ -25,6 +26,7 @@ export class CreateFundComponent implements OnInit {
|
||||
private formBuilder = inject(UntypedFormBuilder);
|
||||
private router = inject(Router);
|
||||
private route = inject(ActivatedRoute);
|
||||
private alertService = inject(AlertService);
|
||||
|
||||
/** Charge form. */
|
||||
fundForm: UntypedFormGroup;
|
||||
@@ -49,6 +51,12 @@ export class CreateFundComponent implements OnInit {
|
||||
submit() {
|
||||
const payload = this.fundForm.getRawValue();
|
||||
this.organizationService.createFund(payload).subscribe((response: any) => {
|
||||
if (response?.rollbackTransaction) {
|
||||
this.alertService.alert({
|
||||
type: 'Success',
|
||||
message: 'Fund creation has been submitted for approval.'
|
||||
});
|
||||
}
|
||||
this.router.navigate(['../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user