From bb71eb3632222302d66092281134813e43c88b2e Mon Sep 17 00:00:00 2001 From: Alessandro Cifani Date: Thu, 23 May 2024 16:24:34 +0200 Subject: [PATCH] feat: show balances in /accounts --- actual.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/actual.ts b/actual.ts index 78dc7b8..76b23b6 100644 --- a/actual.ts +++ b/actual.ts @@ -15,7 +15,13 @@ export async function shutdown() { } export async function getAccounts() { - return api.getAccounts(); + const accounts = await api.getAccounts(); + return Promise.all( + accounts.map(async (a: any) => ({ + ...a, + balance: await getAccountBalance(a.id), + })), + ); } export async function getAccount(id: string) {