Use account directly to load daily balances.
This commit is contained in:
parent
7281d1f11d
commit
fa147e74fc
@ -35,9 +35,9 @@ export class BalanceChartComponent implements OnInit, OnChanges {
|
||||
) {
|
||||
}
|
||||
|
||||
loadData() {
|
||||
loadData(account: Account) {
|
||||
this.dailyBalanceService.query(
|
||||
this.accountIdService.get()
|
||||
account.id
|
||||
).subscribe((results) => {
|
||||
var headers: any[][] = [['date', 'balances', 'expenses', 'revenues']];
|
||||
|
||||
@ -148,8 +148,6 @@ export class BalanceChartComponent implements OnInit, OnChanges {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.loadData();
|
||||
};
|
||||
|
||||
setLines(account: Account) {
|
||||
@ -170,7 +168,8 @@ export class BalanceChartComponent implements OnInit, OnChanges {
|
||||
};
|
||||
|
||||
ngOnChanges(changes) {
|
||||
if('account' in changes) {
|
||||
if('account' in changes && changes.account.currentValue) {
|
||||
this.loadData(changes.account.currentValue);
|
||||
this.setLines(changes.account.currentValue);
|
||||
} else {
|
||||
this.setLines(this.account);
|
||||
|
Loading…
Reference in New Issue
Block a user