todas las cosas para tener lo de los grupos funcional

This commit is contained in:
fede committed 2026-05-15 18:07:27 -03:00
1 parent f3edc5ceb2
commit ad0612c4d8
16 files changed
+668 -112

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
import { API_URL } from '../env';
import { getToken } from './token';
export async function quitarSubGrupo(grupoId: number, childGroupId: number): Promise<void> {
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');
}
}