refactor: get rid of page data types
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
import { error } from '@sveltejs/kit'
|
||||
import type { PageServerLoad } from './$types'
|
||||
import { fetchAPI } from '$utils/api'
|
||||
import { getRandomItems } from 'utils/array'
|
||||
|
||||
|
||||
export const load = (async ({ setHeaders }) => {
|
||||
export const load = async ({ setHeaders }) => {
|
||||
try {
|
||||
// Get total of published photos
|
||||
const totalRes = await fetchAPI(`query {
|
||||
@@ -53,4 +52,4 @@ export const load = (async ({ setHeaders }) => {
|
||||
} catch (err) {
|
||||
throw error(500, err.message)
|
||||
}
|
||||
}) satisfies PageServerLoad
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user