FactuGES_ERP/modules/auth/src/web/hooks.old/use-login.tsx
2025-05-27 19:47:03 +02:00

17 lines
511 B
TypeScript

import { AuthActionResponse, useAuth } from "@/lib/hooks";
import { ILogin_DTO } from "@shared/contexts";
import { UseMutationOptions, useMutation } from "@tanstack/react-query";
import { useQueryKey } from "../useQueryKey";
export const useLogin = (params?: UseMutationOptions<AuthActionResponse, Error, ILogin_DTO>) => {
const keys = useQueryKey();
const { login } = useAuth();
return useMutation({
mutationKey: keys().auth().action("login").get(),
mutationFn: login,
...params,
});
};