retornar null en prstamo usuario

This commit is contained in:
Lemuel Marquez
2021-06-14 03:29:04 -05:00
parent c37b83fba6
commit 9db60c1868
@@ -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;