import { useMutation } from '@tanstack/react-query';
import * as api from '../service/AuthService'
import { type CheckHasAccountType, type LoginWithPasswordType, type RegisterType } from '../types/AuthTypes';

export const useLoginWithPassword = () => {
    return useMutation({
        mutationFn: (variables: LoginWithPasswordType) => api.loginWithPassword(variables),
    });
};

export const useCheckHasAccount = () => {
    return useMutation({
        mutationFn: (variables: CheckHasAccountType) => api.checkHasAccount(variables),
    });
};

export const useRegister = () => {
    return useMutation({
        mutationFn: (variables: RegisterType) => api.register(variables),
    });
};