account page

This commit is contained in:
2026-02-07 00:45:35 -06:00
parent ee80f849bd
commit cd128d7914
13 changed files with 379 additions and 94 deletions
+17
View File
@@ -0,0 +1,17 @@
import type { PageServerLoad } from '$types';
import sql from '$lib/db/db.server';
import type { User } from '$lib/types/user';
export const load: PageServerLoad = async ({ locals }) => {
if (!locals || !locals.user) {
throw Error('Need to be logged in!');
}
const [userData]: User[] = await sql`
SELECT * FROM users WHERE id = ${locals.user.id}
`;
console.log(userData);
return { userData };
};