diff --git a/src/pages/Expedientes.jsx b/src/pages/Expedientes.jsx
index 401be41..2d8453f 100644
--- a/src/pages/Expedientes.jsx
+++ b/src/pages/Expedientes.jsx
@@ -82,6 +82,9 @@ export default function Documents() {
const [selectedContributor, setSelectedContributor] = useState('');
const [loadingContributors, setLoadingContributors] = useState(false);
+ // Estado para agendar todo
+ const [isScheduling, setIsScheduling] = useState(false);
+
// Estado para controlar la animación de entrada
const [showAnimation, setShowAnimation] = useState(false);
const [hasAnimated, setHasAnimated] = useState(false);
@@ -508,6 +511,26 @@ export default function Documents() {
}
};
+ // Función para agendar todo
+ const handleScheduleAll = async () => {
+ setIsScheduling(true);
+
+ try {
+ const endpoint = `${API_URL}/customs/auditor/procesar-pedimentos/organizaciones/`;
+ const result = await postWithAuth(endpoint, {});
+
+ showMessage('Pedimentos agendados exitosamente', 'success');
+
+ // Refrescar la lista después de agendar
+ refetch();
+ } catch (error) {
+ console.error('Error al agendar pedimentos:', error);
+ showMessage(`Error al agendar pedimentos: ${error.message}`, 'error');
+ } finally {
+ setIsScheduling(false);
+ }
+ };
+
// Actualizar isSelectAll cuando cambia la selección
useEffect(() => {
if (currentDocuments.length > 0) {
@@ -815,6 +838,23 @@ export default function Documents() {
Agregar Expedientes
+