is not empty
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import { IsInt, IsString } from 'class-validator';
|
||||
import { IsInt, IsNotEmpty, IsString, MaxLength } from 'class-validator';
|
||||
|
||||
export class MultarDto {
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@MaxLength(250)
|
||||
descripcion: string;
|
||||
|
||||
@IsInt()
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
import { IsNumberString, IsOptional, IsString } from 'class-validator';
|
||||
import {
|
||||
IsNotEmpty,
|
||||
IsNumberString,
|
||||
IsOptional,
|
||||
IsString,
|
||||
} from 'class-validator';
|
||||
|
||||
export class MultasDto {
|
||||
@IsNumberString()
|
||||
@@ -9,6 +14,7 @@ export class MultasDto {
|
||||
id_institucion?: string;
|
||||
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@IsOptional()
|
||||
usuario?: string;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ export class Multa {
|
||||
@Column({ type: Boolean, nullable: false, default: true })
|
||||
activo: boolean;
|
||||
|
||||
@Column({ type: String, nullable: false })
|
||||
@Column({ type: String, nullable: false, length: 250 })
|
||||
descripcion: string;
|
||||
|
||||
@Column({ type: Date, nullable: false })
|
||||
|
||||
@@ -135,6 +135,9 @@ export class MultaService {
|
||||
id_institucion?: string;
|
||||
usuario?: string;
|
||||
}) {
|
||||
const institucion = filtros.id_institucion
|
||||
? await this.institucionService.findById(parseInt(filtros.id_institucion))
|
||||
: null;
|
||||
const query = this.repository
|
||||
.createQueryBuilder('mu')
|
||||
.innerJoinAndSelect('mu.institucionInfraccion', 'ii')
|
||||
@@ -158,9 +161,6 @@ export class MultaService {
|
||||
.addOrderBy('mu.id_multa', 'DESC')
|
||||
.skip((parseInt(filtros.pagina) - 1) * 25)
|
||||
.take(25);
|
||||
const institucion = filtros.id_institucion
|
||||
? await this.institucionService.findById(parseInt(filtros.id_institucion))
|
||||
: null;
|
||||
|
||||
if (filtros.usuario)
|
||||
query.andWhere('u.usuario LIKE :usuario', {
|
||||
|
||||
Reference in New Issue
Block a user