This commit is contained in:
2023-09-26 18:41:50 +00:00
parent 0a89692029
commit a2fa9058d5
7 changed files with 100 additions and 43 deletions

View File

@@ -377,26 +377,7 @@ createApp({
Object.assign(store.current.justificada, store.current.clone_justificada)
delete store.current.clone_justificada
},
get profesores() {
return store.registros.data
.map((registro: Registro) => ({
profesor_id: registro.profesor_id,
profesor_nombre: registro.profesor_nombre,
profesor_correo: registro.profesor_correo,
profesor_clave: registro.profesor_clave,
profesor_grado: registro.profesor_grado,
}))
.reduce((acc: Profesor[], current: Profesor) => {
if (!acc.some(item => item.profesor_id === current.profesor_id)) {
acc.push(current);
}
return acc;
}, [])
.sort((a: Profesor, b: Profesor) =>
a.profesor_nombre.localeCompare(b.profesor_nombre)
);
},
profesores: [] as Profesor[],
async mounted() {
$('div.modal#cargando').modal('show');
@@ -405,6 +386,7 @@ createApp({
await store.estados.fetch()
await store.bloques_horario.fetch()
await store.filters.switchFechas()
this.profesores = await (await fetch('action/action_profesor.php')).json() as Profesor[];
$('div.modal#cargando').modal('hide');
}