mirror of
https://github.com/kremalicious/umami.git
synced 2024-06-29 01:07:55 +02:00
15 lines
329 B
TypeScript
15 lines
329 B
TypeScript
'use client';
|
|
import useApi from './useApi';
|
|
|
|
export function useUser(userId: string, options?: { [key: string]: any }) {
|
|
const { get, useQuery } = useApi();
|
|
return useQuery({
|
|
queryKey: ['users', userId],
|
|
queryFn: () => get(`/users/${userId}`),
|
|
enabled: !!userId,
|
|
...options,
|
|
});
|
|
}
|
|
|
|
export default useUser;
|