FactuGES_ERP/modules/auth/src/web/services/me-service.ts
David d57b71c200 refactor: standardize import statements and formatting across components
- Updated import statements in `textarea.tsx`, `toggle.tsx`, and `tooltip.tsx` for consistency.
- Added missing semicolons and adjusted formatting in `use-mobile.ts` and `use-mobile.tsx`.
- Cleaned up `package.json` and `root.json` files by removing unnecessary line breaks.
- Simplified `turbo.json` by consolidating array formatting for better readability.
2026-09-10 13:26:33 +02:00

19 lines
437 B
TypeScript

import { useDataSource } from "@erp/core/hooks";
import { useQuery } from "@tanstack/react-query";
import { useAuth } from "../hooks";
import type { User } from "./types";
export const useCurrentUser = () => {
const { token } = useAuth();
const client = useDataSource();
return useQuery({
queryKey: ["me"],
queryFn: () => client.getOne<User>("/auth", "me"),
enabled: !!token,
staleTime: 1000 * 60 * 5,
});
};