[chore] Use satisfies syntax for server routes types

This commit is contained in:
2023-01-10 13:02:19 +01:00
parent 25bb949a13
commit 47ea21569d
16 changed files with 35 additions and 48 deletions

View File

@@ -3,7 +3,7 @@ import type { LayoutServerLoad } from './$types'
import { fetchAPI } from '$utils/api'
import { fetchSwell } from '$utils/functions/shopServer'
export const load: LayoutServerLoad = async () => {
export const load = (async () => {
try {
// Get content from API
const res = await fetchAPI(`query {
@@ -75,4 +75,4 @@ export const load: LayoutServerLoad = async () => {
} catch (err) {
throw error(500, err.message)
}
}
}) satisfies LayoutServerLoad

View File

@@ -4,7 +4,7 @@ import { fetchAPI } from '$utils/api'
import { getRandomItem } from '$utils/functions'
import { fetchSwell } from '$utils/functions/shopServer'
export const load: PageServerLoad = async ({ setHeaders }) => {
export const load = (async ({ setHeaders }) => {
try {
// Get content from API
const data = await fetchAPI(`query {
@@ -53,4 +53,4 @@ export const load: PageServerLoad = async ({ setHeaders }) => {
} catch (err) {
throw error(500, err.message)
}
}
}) satisfies PageServerLoad

View File

@@ -3,7 +3,7 @@ import type { PageServerLoad } from './$types'
import { fetchAPI } from '$utils/api'
import { fetchSwell } from '$utils/functions/shopServer'
export const load: PageServerLoad = async ({ params, setHeaders }) => {
export const load = (async ({ params, setHeaders }) => {
try {
// Get content from API
const data = await fetchAPI(`query {
@@ -50,4 +50,4 @@ export const load: PageServerLoad = async ({ params, setHeaders }) => {
} catch (err) {
throw error(404)
}
}
}) satisfies PageServerLoad