2024-02-04 01:01:37 -05:00
|
|
|
import { SECRET_INTERNAL_API_KEY } from '$env/static/private'
|
|
|
|
|
import type { PageServerLoad } from './$types'
|
|
|
|
|
|
2024-02-08 21:47:54 -05:00
|
|
|
export const load: PageServerLoad = async ({ locals, fetch }) => {
|
2024-02-04 01:01:37 -05:00
|
|
|
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 }
|
|
|
|
|
}
|