From 2011018794341dac4b0a26a56724b44cd705a4d9 Mon Sep 17 00:00:00 2001 From: Lemuel Marquez Date: Mon, 1 Mar 2021 19:14:04 -0600 Subject: [PATCH] =?UTF-8?q?fecha=20de=20termino=20a=C3=B1adida?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/controller/Servicio/liberacion.js | 7 ++++++- server/db/tablas/Servicio.js | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/server/controller/Servicio/liberacion.js b/server/controller/Servicio/liberacion.js index 11a2780..321cbe6 100644 --- a/server/controller/Servicio/liberacion.js +++ b/server/controller/Servicio/liberacion.js @@ -1,3 +1,4 @@ +const moment = require('moment'); const validar = require('../../helper/validar'); const gmail = require('../../helper/gmail'); const correos = require('../../helper/correos'); @@ -48,7 +49,11 @@ const liberacion = async (body) => { throw new Error('Id status no valido.'); } }) - .then((res) => Servicio.update(update, { where: { idServicio } })) + .then((res) => + Servicio.update(update, { + where: { idServicio, fechaLiberacion: moment() }, + }) + ) .then((res) => ({ message: 'Se cambio de estatus correctamente y se envio un correo al alumno informandole de su liberación.', diff --git a/server/db/tablas/Servicio.js b/server/db/tablas/Servicio.js index b9037db..8b22b5f 100644 --- a/server/db/tablas/Servicio.js +++ b/server/db/tablas/Servicio.js @@ -44,6 +44,11 @@ Servicio.init( allowNull: true, // eliminar defaultValue: null, }, + fechaLiberacion: { + type: DataTypes.DATE, + allowNull: true, + defaultValue: null, + }, fechaNacimiento: { type: DataTypes.DATE, allowNull: true,