Feature: al borrar un archivo, ya se borra de minio también
Se añadió la peticion DELETE para borrar un archivo de minio
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user