refactor: get rid of page data types

This commit is contained in:
2023-05-26 23:47:08 +02:00
parent 422727586e
commit 685d4fd244
28 changed files with 44 additions and 72 deletions

View File

@@ -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
}