Add getAccount function and update account data retrieval in the account page
This commit is contained in:
@ -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');
|
||||
|
||||
Reference in New Issue
Block a user