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

export function useDeactivateProductType() {
  const queryClient = useQueryClient()
  return useMutation({
    mutationFn: (id: number) => deactivateProductType(id),
    onSuccess: () => {
      queryClient.invalidateQueries({ queryKey: ['product-types'] })
    },
  })
}
