quivr/frontend/lib/hooks/useUserData.ts
Mamadou DICKO a4a2d769b3
feat: allow setting public brain status to private (#1258)
* feat: refetch brains list on when new brain is added

* feat: update BrainConfig type

* feat: update useSettingsTab add usebrainFormState and useSettings tab

* feat: add <PrivateAccessConfirmationModal/> modal

* feat: update translations

* feat: handle brain status change to private

* feat: validate chat access

* test: fix failaing tests and remove deprecated
2023-09-26 10:35:52 +02:00

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,
};
};