Move default value in account constructor.

This commit is contained in:
Alexis Lahouze 2017-07-14 10:15:07 +02:00
parent c6761e1379
commit c4baf94d3a
2 changed files with 5 additions and 7 deletions

View File

@ -58,13 +58,7 @@ export class AccountController {
* Add an empty account. * Add an empty account.
*/ */
add() { add() {
var account = new Account({ return this.modify(new Account());
// eslint-disable-next-line camelcase
authorized_overdraft: 0
});
// Insert account at the begining of the array.
return this.modify(account);
}; };
/* /*

View File

@ -8,4 +8,8 @@ export class Account {
authorized_overdraft: number; authorized_overdraft: number;
balances: AccountBalances; balances: AccountBalances;
constructor() {
this.authorized_overdraft = 0;
}
} }