21 lines
439 B
TypeScript
21 lines
439 B
TypeScript
import { error } from '@sveltejs/kit'
|
|
import type { PageServerLoad } from './$types'
|
|
import { fetchAPI } from '$utils/api'
|
|
|
|
export const load: PageServerLoad = async () => {
|
|
try {
|
|
const res = await fetchAPI(`query {
|
|
legal {
|
|
terms
|
|
}
|
|
}`)
|
|
|
|
const { data } = res
|
|
|
|
return {
|
|
...data
|
|
}
|
|
} catch (err) {
|
|
throw error(500, err.message)
|
|
}
|
|
} |