mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 21:10:38 +03:00
22 lines
453 B
TypeScript
22 lines
453 B
TypeScript
import { useQuery, useSuspenseQuery } from '@tanstack/react-query';
|
|
|
|
import { usersApi } from './api';
|
|
|
|
export function useProfile() {
|
|
const {
|
|
data: profile,
|
|
isLoading,
|
|
error
|
|
} = useQuery({
|
|
...usersApi.getProfileQueryOptions()
|
|
});
|
|
return { profile, isLoading, error };
|
|
}
|
|
|
|
export function useProfileSuspense() {
|
|
const { data: profile } = useSuspenseQuery({
|
|
...usersApi.getProfileQueryOptions()
|
|
});
|
|
return { profile };
|
|
}
|