[chore] Use satisfies syntax for server routes types
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user