Files
cbsnexora/src/app/loans/common-resolvers/loan-details-charges.resolver.ts
T

39 lines
1.1 KiB
TypeScript

/**
* Copyright since 2025 Mifos Initiative
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/** 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.
*/
// eslint-disable-next-line @angular-eslint/prefer-inject
constructor(private loansService: LoansService) {}
/**
* Returns the Loans with Association data.
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const loanId = route.paramMap.get('loanId');
return this.loansService.getLoanAccountAssociationDetails(loanId);
}
}