Se agrego el id del peridodo en automatico al momeno de registrar
This commit is contained in:
@@ -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