fix(core): update

This commit is contained in:
2020-08-20 01:08:05 +00:00
parent 838de2b8bc
commit a3bfd49d6e
3 changed files with 431 additions and 39 deletions

View File

@ -77,6 +77,8 @@ export class BunqAccount {
const users = await this.bunqJSClient.api.user.list();
if (users.UserPerson) {
this.userId = users.UserPerson.id;
} else if (users.UserApiKey) {
this.userId = users.UserApiKey.id;
} else if (users.UserCompany) {
this.userId = users.UserCompany.id;
} else {
@ -85,7 +87,9 @@ export class BunqAccount {
}
public async getAccounts() {
const apiMonetaryAccounts = await this.bunqJSClient.api.monetaryAccount.list(this.userId);
const apiMonetaryAccounts = await this.bunqJSClient.api.monetaryAccount.list(this.userId, {}).catch(e => {
console.log(e);
});
const accountsArray: MonetaryAccount[] = [];
for (const apiAccount of apiMonetaryAccounts) {
accountsArray.push(MonetaryAccount.fromAPIObject(this, apiAccount));