refactor (df/locale): savings module (#1259)

See: #1213
This commit is contained in:
Shubhankar Bhadra
2020-10-16 20:20:36 +05:30
committed by GitHub
parent aeeb2cc5f1
commit 777da45b63
18 changed files with 113 additions and 59 deletions
@@ -7,6 +7,7 @@ import { ActivatedRoute } from '@angular/router';
/** Custom Services */
import { SavingsService } from 'app/savings/savings.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';
@@ -44,11 +45,13 @@ export class StandingInstructionsTabComponent implements OnInit {
/**
* Retrieves Savings Account Data from `resolve`.
* @param {ActivatedRoute} route Activated Route.
* @param {SettingsService} settingsService Setting service
*/
constructor(private route: ActivatedRoute,
private savingsService: SavingsService,
private dialog: MatDialog,
private accountTransfersService: AccountTransfersService) {
private accountTransfersService: AccountTransfersService,
private settingsService: SettingsService) {
this.route.parent.data.subscribe((data: { savingsAccountData: any }) => {
this.savingsData = data.savingsAccountData;
});
@@ -65,8 +68,8 @@ export class StandingInstructionsTabComponent implements OnInit {
const clientId = this.savingsData.clientId;
const clientName = this.savingsData.clientName;
const accountId = this.savingsData.id;
const locale = 'en';
const dateFormat = 'dd MMMM yyyy';
const locale = this.settingsService.language.code;
const dateFormat = this.settingsService.dateFormat;
this.savingsService.getStandingInstructions(clientId, clientName, accountId, locale, dateFormat).subscribe((response: any) => {
this.instructionsData = response.pageItems;
this.dataSource.data = this.instructionsData;