Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

fix validation error

Blue Mouseace740934427
diff --git a/src/captcha/dtos/generate.dto.ts b/src/captcha/dtos/generate.dto.ts
index e1d94b57c..a65dcc05c 100644
--- a/src/captcha/dtos/generate.dto.ts
+++ b/src/captcha/dtos/generate.dto.ts
@@ -1,4 +1,5 @@
import { ApiProperty } from '@nestjs/swagger'
+import { IsOptional } from 'class-validator'
export const DEFAULT_THEME = 'light'
@@ -8,5 +9,6 @@ export class GenerateDTO {
required: false,
description: 'Captcha theme',
})
+ @IsOptional()
theme?: string
}
diff --git a/src/captcha/dtos/validate.dto.ts b/src/captcha/dtos/validate.dto.ts
index aa6c32971..f2b83f101 100644
--- a/src/captcha/dtos/validate.dto.ts
+++ b/src/captcha/dtos/validate.dto.ts
@@ -1,5 +1,5 @@
import { ApiProperty } from '@nestjs/swagger'
-import { IsNotEmpty } from 'class-validator'
+import { IsNotEmpty, IsOptional } from 'class-validator'
export class ValidateDTO {
@ApiProperty({
@@ -20,6 +20,7 @@ export class ValidateDTO {
required: false,
description: 'Captcha hash (if available)',
})
+ @IsOptional()
hash?: string
@ApiProperty({