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,