use h3 instead of trpc

This commit is contained in:
2023-12-09 21:26:41 +01:00
parent f0aa9ebdf4
commit ba067cf533
25 changed files with 1395 additions and 940 deletions

View File

@@ -1,9 +1,9 @@
export default defineNuxtRouteMiddleware(async (to) => {
const isMaintenance = ref<boolean>(true)
const { $trpc } = useNuxtApp()
try {
isMaintenance.value = await $trpc.maintenance.is.query()
await $fetch('/api/maintenance').then((maintenance: any) => {
isMaintenance.value = maintenance.enabled
})
}
catch (error) {
return navigateTo('/maintenance')