diff --git a/project/ws/app/src/lib/head/ui-admin-table/create-organisation/create-organisation.component.ts b/project/ws/app/src/lib/head/ui-admin-table/create-organisation/create-organisation.component.ts index 32271a59..75ff5805 100644 --- a/project/ws/app/src/lib/head/ui-admin-table/create-organisation/create-organisation.component.ts +++ b/project/ws/app/src/lib/head/ui-admin-table/create-organisation/create-organisation.component.ts @@ -47,6 +47,7 @@ export class CreateOrganisationComponent implements OnInit, OnDestroy { untilDestroyed$ = new Subject(); isMatcompleteOpened = false; + EXCLUDED_MINISRIES: string[] = [] constructor( private formBuilder: FormBuilder, private snackBar: MatSnackBar, @@ -60,6 +61,9 @@ export class CreateOrganisationComponent implements OnInit, OnDestroy { ngOnInit(): void { this.loggedInUserId = _.get(this.activatedRoute, 'snapshot.parent.data.configService.userProfile.userId') + this.EXCLUDED_MINISRIES = this.activatedRoute.snapshot.parent ? + this.activatedRoute.snapshot.parent?.data?.pageData?.data?.excludedOrganizationsSborgId : [] + this.initialization() if (this.openMode === 'editMode') { this.getOrganization(this.rowData.organisation, this.rowData.type.toLowerCase()) @@ -81,8 +85,11 @@ export class CreateOrganisationComponent implements OnInit, OnDestroy { this.statesList = _.get(this.dropdownList, 'statesList', []) this.filteredStates = [...this.statesList] - this.ministriesList = _.get(this.dropdownList, 'ministriesList', []) + this.ministriesList = _.get(this.dropdownList, 'ministriesList', []).filter( + (ministry: any) => !this.EXCLUDED_MINISRIES.includes(ministry?.sbOrgId) + ) this.filteredMinistry = [...this.ministriesList] + } this.organisationForm = this.formBuilder.group({