ConnectionInfo and the db ConnectionRow types are now completely seperate things. Started on audio fetching yay!

This commit is contained in:
Eclypsed
2024-04-05 02:00:17 -04:00
parent 952c8383f9
commit c5408d76b6
20 changed files with 220 additions and 253 deletions

View File

@@ -2,9 +2,11 @@ import { SECRET_INTERNAL_API_KEY } from '$env/static/private'
import type { PageServerLoad } from './$types'
export const load: PageServerLoad = async ({ locals, fetch }) => {
const recommendationResponse = await fetch(`/api/users/${locals.user.id}/recommendations`, { headers: { apikey: SECRET_INTERNAL_API_KEY } })
const recommendationData = await recommendationResponse.json()
const { recommendations } = recommendationData
const recommendationResponse = await fetch(`/api/users/${locals.user.id}/recommendations`, {
headers: { apikey: SECRET_INTERNAL_API_KEY },
}).then((response) => response.json())
const recommendations: (Song | Album | Artist | Playlist)[] = recommendationResponse.recommendations
return { recommendations }
}