import { axiosClient } from '@/api/axiosClient'
import type { RubroTreeNode } from '../types'

export async function getRubroTree(incluirInactivos?: boolean): Promise<RubroTreeNode[]> {
  const params = incluirInactivos ? { incluirInactivos: 'true' } : {}
  const response = await axiosClient.get<RubroTreeNode[]>('/api/v1/rubros/tree', { params })
  return response.data
}
