@@ -3,7 +3,7 @@ import { Injectable } from '@angular/core';
|
||||
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
|
||||
|
||||
/** rxjs Imports */
|
||||
import { Observable } from 'rxjs';
|
||||
import { Observable, forkJoin } from 'rxjs';
|
||||
|
||||
/** Custom Services */
|
||||
import { SavingsService } from '../savings.service';
|
||||
@@ -34,8 +34,14 @@ export class SavingsAccountActionsResolver implements Resolve<Object> {
|
||||
return this.savingsService.getSavingsChargeTemplateResource(savingAccountId);
|
||||
case 'Withdrawal':
|
||||
case 'Deposit':
|
||||
case 'Close':
|
||||
return this.savingsService.getSavingsTransactionTemplateResource(savingAccountId);
|
||||
case 'Close':
|
||||
return forkJoin([
|
||||
this.savingsService.getSavingsTransactionTemplateResource(savingAccountId),
|
||||
this.savingsService.getSavingsAccountData(savingAccountId)
|
||||
]);
|
||||
case 'Apply Annual Fees':
|
||||
return this.savingsService.getSavingsAccountData(savingAccountId);
|
||||
default:
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -25,8 +25,9 @@ export class SavingsAccountTemplateResolver implements Resolve<Object> {
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<any> {
|
||||
const clientId = route.parent.parent.paramMap.get('clientId');
|
||||
return this.savingsService.getSavingsAccountTemplate(clientId);
|
||||
const entityId = route.paramMap.get('clientId') || route.paramMap.get('groupId') || route.paramMap.get('centerId');
|
||||
const isGroup = (route.paramMap.get('groupId') || route.paramMap.get('centerId')) ? true : false;
|
||||
return this.savingsService.getSavingsAccountTemplate(entityId, undefined, isGroup);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user