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

export const useProfile = () =>
    useMutation({
        mutationFn: fetchMe,
        onSuccess: (data) => {
            useAuthStore.getState().update(data)
        },
    })
