From 1d5eaf8c9731b8c19564cafe02ce07da816e5dd3 Mon Sep 17 00:00:00 2001 From: xXpuma99Xx <51341582+xXpuma99Xx@users.noreply.github.com> Date: Thu, 3 Feb 2022 12:04:14 -0600 Subject: [PATCH] erorr en regreso sin entrega previa --- server/controller/Prestamo/regresar.js | 2 +- server/controller/Prestamo/regresarNumeroInventario.js | 2 +- server/controller/Prestamo/regresoInmediato.js | 2 +- server/controller/Prestamo/regresoInmediatoNumeroInventario.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/controller/Prestamo/regresar.js b/server/controller/Prestamo/regresar.js index a0fe81d..bd13c85 100644 --- a/server/controller/Prestamo/regresar.js +++ b/server/controller/Prestamo/regresar.js @@ -32,7 +32,7 @@ const regresar = async (body) => { if (!res) throw new Error('No existe este préstamo.'); if (!res.activo && res.idOperadorRegreso) throw new Error('Este préstamo ya no esta activo.'); - if (!res.Equipo.idStatus === 1) + if (res.Equipo.idStatus === 1) throw new Error('Aun no se ha entregado el equipo al usuario.'); diferencia = parseInt((ahora - moment(res.horaFin)) / 60000); if (diferencia >= 15) diff --git a/server/controller/Prestamo/regresarNumeroInventario.js b/server/controller/Prestamo/regresarNumeroInventario.js index dd071ed..490507b 100644 --- a/server/controller/Prestamo/regresarNumeroInventario.js +++ b/server/controller/Prestamo/regresarNumeroInventario.js @@ -46,7 +46,7 @@ const regresarNumeroInventario = async (body) => { .then(async (res) => { if (!res) throw new Error('No existe un prestamo activo con este equipo.'); - if (!res.Equipo.idStatus === 1) + if (res.Equipo.idStatus === 1) throw new Error('Aun no se ha entregado el equipo al usuario.'); idPrestamo = res.idPrestamo; diferencia = parseInt((ahora - moment(res.horaFin)) / 60000); diff --git a/server/controller/Prestamo/regresoInmediato.js b/server/controller/Prestamo/regresoInmediato.js index a040232..e490e20 100644 --- a/server/controller/Prestamo/regresoInmediato.js +++ b/server/controller/Prestamo/regresoInmediato.js @@ -20,7 +20,7 @@ const regresoInmediato = async (body) => { .then(async (res) => { if (!res) throw new Error('No existe este préstamo.'); if (!res.activo) throw new Error('Este préstamo ya no esta activo.'); - if (!res.Equipo.idStatus === 1) + if (res.Equipo.idStatus === 1) throw new Error('Aun no se ha entregado el equipo al usuario.'); diferencia = parseInt((ahora - moment(res.horaFin)) / 60000); if (diferencia >= 15) diff --git a/server/controller/Prestamo/regresoInmediatoNumeroInventario.js b/server/controller/Prestamo/regresoInmediatoNumeroInventario.js index 1434901..af8b5c0 100644 --- a/server/controller/Prestamo/regresoInmediatoNumeroInventario.js +++ b/server/controller/Prestamo/regresoInmediatoNumeroInventario.js @@ -26,7 +26,7 @@ const regresoInmediatoNumeroInventario = async (body) => { .then(async (res) => { if (!res) throw new Error('No existe este préstamo.'); if (!res.activo) throw new Error('Este préstamo ya no esta activo.'); - if (!res.Equipo.idStatus === 1) + if (res.Equipo.idStatus === 1) throw new Error('Aun no se ha entregado el equipo al usuario.'); diferencia = parseInt((ahora - moment(res.horaFin)) / 60000); if (diferencia >= 15)