quivr/frontend/lib/api/user/useUserApi.ts
Stan Girard 322ee318be
feat: the good user management (#1158)
* feat(user_management): added user management

* feat(user_management): added user management

* feat(user_management): removed print

* feat: use tanstack query for user data fecthing

* feat: add getUser to sdk

* feat: improve user page ux use tanstack query

* feat: fetch models from backend on brains settings page

* feat: update model selection on chat page

* feat: update tests

---------

Co-authored-by: mamadoudicko <mamadoudicko100@gmail.com>
2023-09-13 13:47:12 +02:00

22 lines
621 B
TypeScript

import { useAxios } from "@/lib/hooks";
import {
getUser,
getUserIdentity,
updateUserIdentity,
UserIdentityUpdatableProperties,
} from "./user";
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
export const useUserApi = () => {
const { axiosInstance } = useAxios();
return {
updateUserIdentity: async (
userIdentityUpdatableProperties: UserIdentityUpdatableProperties
) => updateUserIdentity(userIdentityUpdatableProperties, axiosInstance),
getUserIdentity: async () => getUserIdentity(axiosInstance),
getUser: async () => getUser(axiosInstance),
};
};