diff --git a/src/app/groups/groups-view/general-tab/general-tab.component.ts b/src/app/groups/groups-view/general-tab/general-tab.component.ts index 7de1b4d33..5177c01d1 100644 --- a/src/app/groups/groups-view/general-tab/general-tab.component.ts +++ b/src/app/groups/groups-view/general-tab/general-tab.component.ts @@ -19,6 +19,7 @@ import { StatusLookupPipe } from '../../../pipes/status-lookup.pipe'; import { AccountsFilterPipe } from '../../../pipes/accounts-filter.pipe'; import { DateFormatPipe } from '../../../pipes/date-format.pipe'; import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module'; +import { GroupsService } from '../../groups.service'; /** * Groups View General Tab Component. @@ -123,11 +124,10 @@ export class GeneralTabComponent { /** Boolean for toggling savings accounts table */ showClosedSavingAccounts = false; - /** - * Fetches group's related data from `resolve` - * @param {ActivatedRoute} route Activated Route. - */ - constructor(private route: ActivatedRoute) { + constructor( + private route: ActivatedRoute, + private groupsService: GroupsService + ) { this.route.data.subscribe( (data: { groupAccountsData: any; groupClientMembers: any; groupSummary: any; glimData: any; gsimData: any }) => { this.glimAccounts = data.glimData; @@ -143,6 +143,18 @@ export class GeneralTabComponent { }); } + /** + * Refreshes group account data from backend (for GSIM/GLIM status/balance update) + */ + refreshAccounts(groupId: string) { + this.groupsService.getGroupAccountsData(groupId).subscribe((data: any) => { + this.groupAccountData = data; + this.savingAccounts = data.savingsAccounts; + this.loanAccounts = data.loanAccounts; + // If GSIM/GLIM data is separate, fetch and update here as well + }); + } + /** * Toggles loan accounts table. */ diff --git a/src/app/groups/groups-view/groups-view.component.ts b/src/app/groups/groups-view/groups-view.component.ts index 3b46f2904..10113c285 100644 --- a/src/app/groups/groups-view/groups-view.component.ts +++ b/src/app/groups/groups-view/groups-view.component.ts @@ -100,6 +100,12 @@ export class GroupsViewComponent { case 'Manage Members': case 'Transfer Clients': this.router.navigate([`actions/${name}`], { relativeTo: this.route }); + if (name === 'Activate') { + const generalTab = this.getGeneralTabComponent(); + if (generalTab) { + generalTab.refreshAccounts(this.groupViewData.id); + } + } break; case 'Edit Meeting': const queryParams: any = { calendarId: this.groupViewData.collectionMeetingCalendar.id }; @@ -116,7 +122,9 @@ export class GroupsViewComponent { break; } } - + getGeneralTabComponent(): any { + return null; + } /** * Checks if meeting is editable. */ @@ -129,7 +137,6 @@ export class GroupsViewComponent { } return false; } - /** * Refetches data for the component * TODO: Replace by a custom reload component instead of hard-coded back-routing.