add web ui and user route

This commit is contained in:
2026-02-15 19:29:09 +03:00
parent 8d9b5c32c6
commit 7ced62517a
24 changed files with 3025 additions and 0 deletions

19
web/src/api/user.ts Normal file
View File

@@ -0,0 +1,19 @@
import { useQuery } from "@tanstack/react-query";
export type User = {
id: number;
login: string;
createdAt: string;
updatedAt: string;
deletedAt: string | null;
};
export const useUserQuery = () => {
return useQuery({
queryKey: ["user"],
queryFn: async () => {
const resp = await fetch("/api/user");
return (await resp.json()) as User;
},
});
};