refactor: savings module (#1226)

See: #1196
This commit is contained in:
Karan Takalkar
2020-08-25 17:46:54 +05:30
committed by GitHub
parent f215e1aa96
commit efdd779aa9
30 changed files with 129 additions and 103 deletions
@@ -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);
}
}