import { API_URL } from '../env'; import { getToken } from './token'; export async function quitarSubGrupo(grupoId: number, childGroupId: number): Promise { const response = await fetch(`${API_URL}/grupos/${grupoId}/subgrupos`, { method: 'DELETE', headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${getToken()}` }, body: JSON.stringify({ child_group_id: childGroupId }) }); if (!response.ok) { const error = await response.json().catch(() => ({ message: 'Error desconocido' })); throw new Error(error.message || 'Error al quitar subgrupo'); } }