From 9db60c18681e1e05fa93ff718b5a1f4c61cb94dd Mon Sep 17 00:00:00 2001 From: Lemuel Marquez Date: Mon, 14 Jun 2021 03:29:04 -0500 Subject: [PATCH] retornar null en prstamo usuario --- server/controller/Prestamo/prestamoUsuario.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/controller/Prestamo/prestamoUsuario.js b/server/controller/Prestamo/prestamoUsuario.js index 1ebfb0f..9a1c2c9 100644 --- a/server/controller/Prestamo/prestamoUsuario.js +++ b/server/controller/Prestamo/prestamoUsuario.js @@ -32,7 +32,7 @@ const prestamo = async (body) => { }); }) .then((res) => { - if (!res) throw new Error('Este usuario no tiene un prestamo activo.'); + if (!res) return null; delete res.dataValues.idUsuario; delete res.dataValues.idOperadorEntrega; delete res.dataValues.idOperadorRegreso;