update to nuxt 4

This commit is contained in:
DecDuck
2025-09-20 11:20:49 +10:00
parent b4f9b77809
commit 2db8e753b7
313 changed files with 508 additions and 512 deletions

13
app/composables/user.ts Normal file
View File

@ -0,0 +1,13 @@
import type { UserModel } from "~~/prisma/client/models";
// undefined = haven't check
// null = check, no user
// {} = check, user
export const useUser = () => useState<UserModel | undefined | null>(undefined);
export const updateUser = async () => {
const user = useUser();
if (user.value === null) return;
user.value = await $dropFetch<UserModel | null>("/api/v1/user");
};