fixing [200~findByCuenta~
This commit is contained in:
@@ -26,24 +26,16 @@ export class BitacoraMesaService {
|
||||
}
|
||||
|
||||
async findByCuenta(id_cuenta: number) {
|
||||
const alumno = await this.bitacoraMesaRepository.findOne({
|
||||
where: {
|
||||
alumno_inscrito: {
|
||||
alumno: {
|
||||
id_cuenta: id_cuenta,
|
||||
},
|
||||
},
|
||||
},
|
||||
relations: {
|
||||
alumno_inscrito: {
|
||||
alumno: true,
|
||||
},
|
||||
mesa: true,
|
||||
},
|
||||
order: {
|
||||
tiempo_entrada: 'DESC',
|
||||
},
|
||||
});
|
||||
const alumno = await this.bitacoraMesaRepository
|
||||
.createQueryBuilder('bitacora')
|
||||
.leftJoinAndSelect('bitacora.alumno_inscrito', 'alumnoInscrito')
|
||||
.leftJoinAndSelect('alumnoInscrito.alumno', 'alumno')
|
||||
.leftJoinAndSelect('alumno.carrera', 'carrera')
|
||||
.leftJoinAndSelect('bitacora.mesa', 'mesa')
|
||||
.where('alumno.id_cuenta = :id_cuenta', { id_cuenta })
|
||||
.orderBy('bitacora.tiempo_entrada', 'DESC')
|
||||
.getOne();
|
||||
|
||||
if (!alumno) {
|
||||
throw new NotFoundException('alumno sin mesa');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user