[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 { RequestHandler } from './$types'
import { fetchAPI } from '$utils/api'
export const GET: RequestHandler = async ({ url, setHeaders }) => {
export const GET = (async ({ url, setHeaders }) => {
try {
const locations = []
const products = []
@@ -72,7 +72,8 @@ export const GET: RequestHandler = async ({ url, setHeaders }) => {
} catch (err) {
throw error(500, err.message)
}
}
}) satisfies RequestHandler
const render = (origin: string, pages: any[]) => {
return `<?xml version="1.0" encoding="UTF-8"?>
@@ -90,4 +91,4 @@ const render = (origin: string, pages: any[]) => {
<changefreq>${frequency}</changefreq>
</url>`).join('')}
</urlset>`
}
}