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

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