We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 25ed5d4 commit b828437Copy full SHA for b828437
sveltekit-app/src/routes/post/[slug]/+page.server.ts
@@ -3,14 +3,15 @@ import type {PageServerLoad} from './$types'
3
4
export const load: PageServerLoad = async ({locals, params}) => {
5
const {loadQuery} = locals.sanity
6
- const initial = await loadQuery<Post>(query, params)
+ const {slug} = params
7
+ const initial = await loadQuery<Post>(query, {slug})
8
9
// We pass the data in a format that is easy for `useQuery` to consume in the
10
// corresponding `+page.svelte` file, but you can return the data in any
11
// format you like.
12
return {
13
query,
- params,
14
+ params: {slug},
15
options: {initial},
16
}
17
0 commit comments