feat: add loan view page (charges tab) (#820)

Fixes: #816
This commit is contained in:
Muskan Khedia
2020-06-01 14:55:10 +05:30
committed by GitHub
parent 03774be790
commit 51c29a073e
10 changed files with 231 additions and 4 deletions
@@ -0,0 +1,31 @@
/** Angular Imports */
import { Injectable } from '@angular/core';
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
/** rxjs Imports */
import { Observable } from 'rxjs';
/** Custom Services */
import { LoansService } from '../loans.service';
/**
* Clients data resolver.
*/
@Injectable()
export class LoanDetailsChargesResolver implements Resolve<Object> {
/**
* @param {LoansService} LoansService Loans service.
*/
constructor(private loansService: LoansService) { }
/**
* Returns the Loans with Association data.
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const loanId = route.parent.paramMap.get('loanId');
return this.loansService.getLoanAccountAssociationDetails(loanId);
}
}
@@ -20,12 +20,12 @@ export class LoanDetailsResolver implements Resolve<Object> {
constructor(private loansService: LoansService) { }
/**
* Returns the Loans data.
* Returns the Loans with Association data.
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const loanId = route.paramMap.get('loanId');
return this.loansService.getLoanAccountDetails(loanId);
return this.loansService.getLoanAccountAssociationDetails(loanId);
}
}