Create Terms page
This commit is contained in:
21
src/routes/terms/+page.server.ts
Normal file
21
src/routes/terms/+page.server.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user