mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-14 13:19:05 +03:00
9293b7d782
https://github.com/StanGirard/quivr/issues/1361 https://github.com/StanGirard/quivr/assets/63923024/cc4b1c0a-363a-49f3-8306-181151554b34 --------- Co-authored-by: Zineb El Bachiri <100568984+gozineb@users.noreply.github.com>
20 lines
592 B
TypeScript
20 lines
592 B
TypeScript
import { useAxios } from "@/lib/hooks";
|
|
import { Onboarding } from "@/lib/types/Onboarding";
|
|
|
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
export const useOnboardingApi = () => {
|
|
const { axiosInstance } = useAxios();
|
|
const getOnboarding = async () => {
|
|
return (await axiosInstance.get<Onboarding>("/onboarding")).data;
|
|
};
|
|
const updateOnboarding = async (onboarding: Partial<Onboarding>) => {
|
|
return (await axiosInstance.put<Onboarding>("/onboarding", onboarding))
|
|
.data;
|
|
};
|
|
|
|
return {
|
|
getOnboarding,
|
|
updateOnboarding,
|
|
};
|
|
};
|