mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-15 09:32:22 +03:00
19 lines
440 B
TypeScript
19 lines
440 B
TypeScript
|
import { useQuery } from "@tanstack/react-query";
|
||
|
|
||
|
import { USER_DATA_KEY } from "../api/user/config";
|
||
|
import { useUserApi } from "../api/user/useUserApi";
|
||
|
|
||
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||
|
export const useUserData = () => {
|
||
|
const { getUser } = useUserApi();
|
||
|
|
||
|
const { data: userData } = useQuery({
|
||
|
queryKey: [USER_DATA_KEY],
|
||
|
queryFn: getUser,
|
||
|
});
|
||
|
|
||
|
return {
|
||
|
userData,
|
||
|
};
|
||
|
};
|