I'm tired
This commit is contained in:
12
src/routes/(app)/+page.server.ts
Normal file
12
src/routes/(app)/+page.server.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { SECRET_INTERNAL_API_KEY } from '$env/static/private'
|
||||
import type { PageServerLoad } from './$types'
|
||||
|
||||
export const prerender = false
|
||||
|
||||
export const load: PageServerLoad = async ({ locals, fetch, url }) => {
|
||||
const recommendationResponse = await fetch(`/api/users/${locals.user.id}/recommendations`, { headers: { apikey: SECRET_INTERNAL_API_KEY } })
|
||||
const recommendationData = await recommendationResponse.json()
|
||||
const { recommendations } = recommendationData
|
||||
|
||||
return { recommendations }
|
||||
}
|
||||
Reference in New Issue
Block a user