From 42ddbaea336c894fc4e5cfd3bf7d3b6d1bf92378 Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 25 Aug 2022 15:22:14 +0200 Subject: [PATCH] Fixed validation errors --- dto/src/responses/base.ts | 5 +++++ dto/src/responses/fs.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dto/src/responses/base.ts b/dto/src/responses/base.ts index 48ec026..7667e40 100644 --- a/dto/src/responses/base.ts +++ b/dto/src/responses/base.ts @@ -1,8 +1,13 @@ +import { IsNumber, Max, Min } from 'class-validator'; + export class BaseResponse { constructor(statusCode: number) { this.statusCode = statusCode; } + @IsNumber() + @Min(100) + @Max(599) statusCode: number; } diff --git a/dto/src/responses/fs.ts b/dto/src/responses/fs.ts index b4c0ef0..2ecb48c 100644 --- a/dto/src/responses/fs.ts +++ b/dto/src/responses/fs.ts @@ -38,7 +38,7 @@ export class GetNodeResponse extends SuccessResponse { @Min(1) id: number; - @IsNotEmpty() + @IsString() name: string; @IsBoolean()