Se agrego el id del peridodo en automatico al momeno de registrar
This commit is contained in:
Generated
+1364
-3014
File diff suppressed because it is too large
Load Diff
+4
-4
@@ -17,8 +17,8 @@
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"axios": "^0.25.0",
|
||||
"bcrypt": "^5.0.1",
|
||||
"axios": "^1.13.4",
|
||||
"bcrypt": "^6.0.0",
|
||||
"body-parser": "^1.19.0",
|
||||
"colors": "^1.4.0",
|
||||
"convert-array-to-csv": "^2.0.0",
|
||||
@@ -28,10 +28,10 @@
|
||||
"express": "^4.17.1",
|
||||
"fs": "^0.0.1-security",
|
||||
"gmail-send": "^1.8.14",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"jsonwebtoken": "^9.0.3",
|
||||
"mariadb": "^2.5.3",
|
||||
"moment": "^2.29.1",
|
||||
"multer": "^1.4.4",
|
||||
"multer": "^2.0.2",
|
||||
"nodemailer": "^7.0.5",
|
||||
"sequelize": "^6.6.2",
|
||||
"validator": "^13.6.0"
|
||||
|
||||
@@ -37,10 +37,23 @@ async function realizarInscripcion(req, res) {
|
||||
});
|
||||
}
|
||||
|
||||
// Validacion del periodo
|
||||
const periodoActivo = await Periodo.findOne({
|
||||
where: {
|
||||
activo: 1 // o true
|
||||
}
|
||||
});
|
||||
|
||||
if (!periodoActivo) {
|
||||
throw new Error("No hay un periodo activo");
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 3. Crear inscripción
|
||||
await AlumnoInscrito.create({
|
||||
id_cuenta: usuario.id_cuenta,
|
||||
id_periodo: 27,
|
||||
id_periodo: periodoActivo.id_periodo,
|
||||
id_plataforma: 5,
|
||||
fecha_inscripcion: new Date(),
|
||||
tiempo_disponible: 3600,
|
||||
|
||||
Reference in New Issue
Block a user