refactor (df/locale): loans module (#1264)

See: #1213
This commit is contained in:
Shubhankar Bhadra
2020-10-25 13:06:23 +05:30
committed by GitHub
parent 2b5341aa2c
commit 9d438b140e
26 changed files with 179 additions and 84 deletions
@@ -7,6 +7,7 @@ import { ActivatedRoute } from '@angular/router';
/** Custom Services */
import { LoansService } from 'app/loans/loans.service';
import { AccountTransfersService } from 'app/account-transfers/account-transfers.service';
import { SettingsService } from 'app/settings/settings.service';
/** Dialog Components */
import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.component';
@@ -36,11 +37,13 @@ export class StandingInstructionsTabComponent implements OnInit {
/**
* Retrieves Loans Account Data from `resolve`.
* @param {ActivatedRoute} route Activated Route.
* @param {SettingsService} settingsService Settings Service
*/
constructor(private route: ActivatedRoute,
private loansService: LoansService,
private dialog: MatDialog,
private accountTransfersService: AccountTransfersService) {
private accountTransfersService: AccountTransfersService,
private settingsService: SettingsService) {
this.route.parent.data.subscribe((data: { loanDetailsData: any }) => {
this.loanDetailsData = data.loanDetailsData;
});
@@ -57,8 +60,8 @@ export class StandingInstructionsTabComponent implements OnInit {
const clientId = this.loanDetailsData.clientId;
const clientName = this.loanDetailsData.clientName;
const accountId = this.loanDetailsData.id;
const locale = 'en';
const dateFormat = 'dd MMMM yyyy';
const locale = this.settingsService.language.code;
const dateFormat = this.settingsService.dateFormat;
this.loansService.getStandingInstructions(clientId, clientName, accountId, locale, dateFormat).subscribe((response: any) => {
this.instructionsData = response.pageItems;
this.dataSource.data = this.instructionsData;