From b3ca317e5e259d0f3a24b3f75783c9c6dae6c150 Mon Sep 17 00:00:00 2001 From: Guillermo Arrieta Medina Date: Fri, 3 Oct 2025 12:58:29 -0600 Subject: [PATCH] =?UTF-8?q?Feature:=20al=20borrar=20un=20archivo,=20ya=20s?= =?UTF-8?q?e=20borra=20de=20minio=20tambi=C3=A9n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Se añadió la peticion DELETE para borrar un archivo de minio --- src/routes/_authenticated/archivos.tsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/routes/_authenticated/archivos.tsx b/src/routes/_authenticated/archivos.tsx index d4ed468..3449974 100644 --- a/src/routes/_authenticated/archivos.tsx +++ b/src/routes/_authenticated/archivos.tsx @@ -72,6 +72,21 @@ function RouteComponent() { .delete() .eq("documentos_id", id) if (error) return alert(error.message) + + try { + const res = await fetch(`${import.meta.env.VITE_BACK_ORIGIN}/api/eliminar/documento`, { + method: "DELETE", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ documentos_id: id }), + }) + + if (!res.ok) { + throw new Error("Se falló al eliminar el documento") + } + } catch (err) { + console.error("Error al eliminar el documento:", err) + } + router.invalidate() }