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

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