feat: add view loan page (datatables-tab) (#853)
Fixes: #840 Fixes: #841
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
/** 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';
|
||||
|
||||
/**
|
||||
* Loans notes data resolver.
|
||||
*/
|
||||
@Injectable()
|
||||
export class LoanDatatableResolver implements Resolve<Object> {
|
||||
|
||||
/**
|
||||
* @param {LoansService} LoansService Loans service.
|
||||
*/
|
||||
constructor(private loansService: LoansService) { }
|
||||
|
||||
/**
|
||||
* Returns the Loans Notes Data.
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<any> {
|
||||
const loanId = route.parent.parent.paramMap.get('loanId');
|
||||
const datatableName = route.paramMap.get('datatableName');
|
||||
return this.loansService.getLoanDatatable(loanId, datatableName);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
/** Angular Imports */
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Resolve } from '@angular/router';
|
||||
|
||||
/** rxjs Imports */
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
/** Custom Services */
|
||||
import { LoansService } from '../loans.service';
|
||||
|
||||
/**
|
||||
* loan datatables resolver.
|
||||
*/
|
||||
@Injectable()
|
||||
export class LoanDatatablesResolver implements Resolve<Object> {
|
||||
|
||||
/**
|
||||
* @param {loansService} loansService loans service.
|
||||
*/
|
||||
constructor(private loansService: LoansService) { }
|
||||
|
||||
/**
|
||||
* Returns the loan datatables.
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
resolve(): Observable<any> {
|
||||
return this.loansService.getLoanDataTables();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user