Add getAccount function and update account data retrieval in the account page

This commit is contained in:
2025-07-08 21:54:20 -04:00
parent 592d21592b
commit 7cc8500fc7
3 changed files with 33 additions and 20 deletions

View File

@ -4,7 +4,7 @@
let trans = $derived(data.transactions);
let notes = $state('');
let currentTransaction = $state(null);
let account = $derived(data.accounts.find((a) => a.id == data.slug) || {});
let account = $derived(data.account);
let hide = $derived(account?.hide || false);
let inTotal = $derived(account?.in_total || false);
@ -54,7 +54,7 @@
<div class="flex mb-4">
<div class="w-128 flex-none justify-bottom"><h1 class="text-xl font-bold">{account?.name}</h1></div>
<div class="w-64 grow">{account?.amount}</div>
<div class="w-64 grow">{account?.balance}</div>
<div class="w-14 flex-none text-right">
<svg onclick={()=>settings_modal.showModal()} fill="#000000" height="20px" width="20px" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 478.703 478.703" xml:space="preserve">