import { useMutation } from '@tanstack/react-query'
import { useAuthStore } from '@/zustand/authStore'
import { login } from '@/lib/api/auth/login'

export const useLogin = () =>
    useMutation({
        mutationFn: login,
        onSuccess: (data) => {
            useAuthStore.getState().login(data)
        },
    })
