mirror of
https://github.com/BradNut/umami
synced 2025-09-08 17:40:29 +00:00
13 lines
315 B
TypeScript
13 lines
315 B
TypeScript
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;
|