mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-15 17:43:03 +03:00
4aeb00fd47
# Description TODO BEFORE RELEASE - [ ] Onboarded true for all existing users ## Checklist before requesting a review Please delete options that are not relevant. - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my code - [ ] I have commented hard-to-understand areas - [ ] I have ideally added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged ## Screenshots (if appropriate): --------- Co-authored-by: Stan Girard <girard.stanislas@gmail.com>
26 lines
655 B
TypeScript
26 lines
655 B
TypeScript
import { useQuery } from "@tanstack/react-query";
|
|
|
|
import { USER_DATA_KEY, USER_IDENTITY_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 { getUserIdentity } = useUserApi();
|
|
|
|
const { data: userData } = useQuery({
|
|
queryKey: [USER_DATA_KEY],
|
|
queryFn: getUser,
|
|
});
|
|
|
|
const { data: userIdentityData } = useQuery({
|
|
queryKey: [USER_IDENTITY_DATA_KEY],
|
|
queryFn: getUserIdentity,
|
|
});
|
|
|
|
return {
|
|
userData,
|
|
userIdentityData,
|
|
};
|
|
};
|