Fixed validation errors

This commit is contained in:
Mutzi 2022-08-25 15:22:14 +02:00
parent f6e92abbb8
commit 42ddbaea33
2 changed files with 6 additions and 1 deletions

View File

@ -1,8 +1,13 @@
import { IsNumber, Max, Min } from 'class-validator';
export class BaseResponse { export class BaseResponse {
constructor(statusCode: number) { constructor(statusCode: number) {
this.statusCode = statusCode; this.statusCode = statusCode;
} }
@IsNumber()
@Min(100)
@Max(599)
statusCode: number; statusCode: number;
} }

View File

@ -38,7 +38,7 @@ export class GetNodeResponse extends SuccessResponse {
@Min(1) @Min(1)
id: number; id: number;
@IsNotEmpty() @IsString()
name: string; name: string;
@IsBoolean() @IsBoolean()