From 9741afc8ae13f2e9f32ade753821bdf4f7db5b8d Mon Sep 17 00:00:00 2001 From: xXpuma99Xx <51341582+xXpuma99Xx@users.noreply.github.com> Date: Tue, 22 Feb 2022 21:35:07 -0600 Subject: [PATCH] sin horario --- server/controller/Prestamo/entregar.js | 7 ++++--- server/controller/Prestamo/pedir.js | 8 ++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/server/controller/Prestamo/entregar.js b/server/controller/Prestamo/entregar.js index 983ed4d..d443f67 100644 --- a/server/controller/Prestamo/entregar.js +++ b/server/controller/Prestamo/entregar.js @@ -50,9 +50,10 @@ const entregar = async (body) => { 'Ya pasó el tiempo límite para recoger el equipo de cómputo.' ); }); - if (ahora > moment(`${ahora.format('YYYY-MM-DD')} 17:45`)) - update.horaFin = moment(`${ahora.format('YYYY-MM-DD')} 19:45`); - else update.horaFin = ahora.add(2, 'h').format(); + // if (ahora > moment(`${ahora.format('YYYY-MM-DD')} 17:45`)) + // update.horaFin = moment(`${ahora.format('YYYY-MM-DD')} 19:45`); + // else + update.horaFin = ahora.add(2, 'h').format(); return Equipo.update( { idStatus: 2, prestado: true }, { where: { idEquipo } } diff --git a/server/controller/Prestamo/pedir.js b/server/controller/Prestamo/pedir.js index b486710..db1b6a8 100644 --- a/server/controller/Prestamo/pedir.js +++ b/server/controller/Prestamo/pedir.js @@ -34,10 +34,10 @@ const pedir = async (body) => { throw new Error( 'No se puede pedir un equipo de cómputo los días sabados y domingos.' ); - if (ahora > horaMax) - throw new Error('Ya no se puede realizar un préstamo el día de hoy.'); - if (ahora < horaMin) - throw new Error('Aún es muy temprano para realizar un préstamo.'); + // if (ahora > horaMax) + // throw new Error('Ya no se puede realizar un préstamo el día de hoy.'); + // if (ahora < horaMin) + // throw new Error('Aún es muy temprano para realizar un préstamo.'); return TipoCarrito.findOne({ where: { idTipoCarrito } }) .then((res) => { if (!res) throw new Error('No existe este tipo de equipo.');