import { useMutation, useQueryClient } from '@tanstack/react-query'
import { updatePhone } from '../api/profileApi'

export function useUpdatePhone() {
  const queryClient = useQueryClient()
  return useMutation<void, unknown, string>({
    mutationFn: updatePhone,
    onSuccess: () => {
      queryClient.invalidateQueries({ queryKey: ['me'] })
    },
  })
}
