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

@ -1,12 +1,13 @@
import { error } from '@sveltejs/kit';
import { getTransactions } from '$lib/db';
import { getAccount, getTransactions } from '$lib/db';
/** @type {import('./$types').PageServerLoad} */
export async function load({ params }) {
const transactions = await getTransactions(params.slug);
const account = await getAccount(params.slug);
const slug = params.slug;
if (transactions) {
return {transactions, slug};
return {transactions, account};
}
error(404, 'Not found');