import type { PageServerLoad } from './$types'; import { prisma } from '$lib/db'; import { error } from '@sveltejs/kit'; export const load: PageServerLoad = async ({ locals }) => { if (!locals.user?.id) { throw error(403, 'not authorized'); } const licenseKeys = await prisma.licenseKey.findMany({ where: { userId: locals.user.id }, orderBy: { key: 'asc' } }); return { licenseKeys }; };