mirror of
https://github.com/umami-software/umami.git
synced 2026-05-30 06:47:25 +00:00
12 lines
297 B
TypeScript
12 lines
297 B
TypeScript
import { useApi } from '../useApi';
|
|
|
|
export function useUserQuery(userId: string, options?: Record<string, any>) {
|
|
const { get, useQuery } = useApi();
|
|
return useQuery({
|
|
queryKey: ['users', userId],
|
|
queryFn: () => get(`/users/${userId}`),
|
|
enabled: !!userId,
|
|
...options,
|
|
});
|
|
}
|