import { getAktisWithAvgRating } from '$lib/server/db/queries'; import type { PageServerLoad } from './$types'; export const load: PageServerLoad = async ({ url }) => { const offset = Number(url.searchParams.get('offset')) || 0; const limit = 20; const a = await getAktisWithAvgRating(limit, offset); return { aktis: a.map((a) => ({ ...a, rating: a.rating ? parseFloat(a.rating) : undefined })) }; };