From a86ebf9d9f370fd177239750245ae2da09f40a74 Mon Sep 17 00:00:00 2001 From: Innei Date: Wed, 22 Sep 2021 14:41:20 +0800 Subject: [PATCH] fix: unqi ip and spam keyword --- src/modules/configs/configs.dto.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modules/configs/configs.dto.ts b/src/modules/configs/configs.dto.ts index 56e512ae..96ff7c10 100644 --- a/src/modules/configs/configs.dto.ts +++ b/src/modules/configs/configs.dto.ts @@ -1,9 +1,11 @@ import { ApiProperty } from '@nestjs/swagger' import { Transform, Type } from 'class-transformer' import { + ArrayUnique, IsBoolean, IsEmail, IsInt, + IsIP, IsNotEmpty, IsOptional, IsString, @@ -87,9 +89,11 @@ export class CommentOptionsDto { @IsString({ each: true }) @IsOptional() + @ArrayUnique() spamKeywords?: string[] - @IsString({ each: true }) + @IsIP(undefined, { each: true }) + @ArrayUnique() @IsOptional() blockIps?: string[] @IsOptional()