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

export function useReactivateMedio() {
  const queryClient = useQueryClient()
  return useMutation({
    mutationFn: (id: number) => reactivateMedio(id),
    onSuccess: () => {
      queryClient.invalidateQueries({ queryKey: ['medios'] })
    },
  })
}
