@@ -649,8 +736,6 @@ export default function UserForm() {
)}
-
- {/* Indicadores de validación */}
{showPasswordValidation && (
@@ -736,7 +821,7 @@ export default function UserForm() {
- {/* Botones de acción */}
+ {/* Botones */}
diff --git a/src/utils/downloadUtils.js b/src/utils/downloadUtils.js
index 6fdcd8d..dc3e483 100644
--- a/src/utils/downloadUtils.js
+++ b/src/utils/downloadUtils.js
@@ -1,4 +1,5 @@
import { fetchWithAuth } from '../fetchWithAuth';
+import { extractApiError } from '../api/apiError';
const API_URL = import.meta.env.VITE_EFC_API_URL;
@@ -13,7 +14,8 @@ export const downloadFile = async (id, filename = 'archivo', showMessage) => {
const res = await fetchWithAuth(`${API_URL}/record/documents/descargar/${id}/`);
if (!res.ok) {
- showMessage('Error en la descarga del archivo', 'error');
+ const errMsg = await extractApiError(res);
+ showMessage(errMsg, 'error');
return;
}
@@ -50,8 +52,11 @@ export const downloadBulkZip = async (ids, showMessage, pedimentoName) => {
body: JSON.stringify({ document_ids: ids })
});
- if (!response.ok) throw new Error('Error en la descarga');
-
+ if (!response.ok) {
+ const errMsg = await extractApiError(response);
+ throw new Error(errMsg);
+ }
+
const blob = await response.blob();
const url = window.URL.createObjectURL(blob);
const a = document.createElement('a');