mirror of
https://github.com/ArthurDanjou/website.git
synced 2026-01-22 16:00:35 +01:00
use h3 instead of trpc
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user