sin infraccion
This commit is contained in:
@@ -4,7 +4,7 @@ import {
|
||||
NotFoundException,
|
||||
} from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { Not, Repository } from 'typeorm';
|
||||
import { Infraccion } from './entity/infraccion.entity';
|
||||
import { InstitucionInfraccion } from './entity/institucion-infraccion.entity';
|
||||
import { Operador } from '../operador/entity/operador.entity';
|
||||
@@ -45,7 +45,10 @@ export class InstitucionInfraccionService {
|
||||
}
|
||||
|
||||
findAll() {
|
||||
return this.infraccionRepository.find({ order: { infraccion: 'ASC' } });
|
||||
return this.infraccionRepository.find({
|
||||
where: { id_infraccion: Not(1) },
|
||||
order: { infraccion: 'ASC' },
|
||||
});
|
||||
}
|
||||
|
||||
findAllByIdInstitucion(id_institucion: number) {
|
||||
@@ -54,12 +57,12 @@ export class InstitucionInfraccionService {
|
||||
.then((institucion) =>
|
||||
this.institucionInfraccionRepository
|
||||
.createQueryBuilder('ii')
|
||||
.innerJoinAndSelect('ii.infraccion', 'i')
|
||||
.innerJoinAndSelect('ii.institucion', 'in')
|
||||
.where('in.id_institucion = :id_institucion', {
|
||||
.innerJoinAndSelect('ii.infraccion', 'inf')
|
||||
.innerJoinAndSelect('ii.institucion', 'i')
|
||||
.where('i.id_institucion = :id_institucion && inf.id_infraccion != 1', {
|
||||
id_institucion: institucion.id_institucion,
|
||||
})
|
||||
.orderBy('i.infraccion')
|
||||
.orderBy('inf.infraccion')
|
||||
.getMany(),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user