Structure coming along
This commit is contained in:
13
src/routes/account/[slug]/+page.server.js
Normal file
13
src/routes/account/[slug]/+page.server.js
Normal file
@ -0,0 +1,13 @@
|
||||
import { error } from '@sveltejs/kit';
|
||||
import { getTransactions } from '$lib/db';
|
||||
|
||||
/** @type {import('./$types').PageServerLoad} */
|
||||
export async function load({ params }) {
|
||||
const transactions = await getTransactions(params.slug);
|
||||
|
||||
if (transactions) {
|
||||
return {transactions};
|
||||
}
|
||||
|
||||
error(404, 'Not found');
|
||||
}
|
||||
Reference in New Issue
Block a user