Render thread pages on the server

This commit is contained in:
dtonon 2026-08-17 18:29:26 +01:00
parent 40e0be35d9
commit c23428f904
4 changed files with 32 additions and 3 deletions

View file

@ -0,0 +1,10 @@
import { snapshot, type Profiles } from "$lib/forum/snapshot";
import type { ThreadDetail } from "$lib/forum/thread";
export async function load({ fetch, params }) {
const data = await snapshot<{ thread: ThreadDetail; profiles: Profiles }>(
fetch,
`/api/thread/${params.id}`,
);
return { thread: data?.thread ?? null, profiles: data?.profiles ?? null };
}