comment func implemented
This commit is contained in:
1 parent
3718882f5b
commit
d7b82c0ec9
2 files changed
+54
-6
No files matched your search
@@ -6,7 +6,9 @@ import {
|
||||
IsInt,
|
||||
Min,
|
||||
Max,
|
||||
MaxLength,
|
||||
} from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
|
||||
interface CommentEntity {
|
||||
id: string;
|
||||
@@ -29,7 +31,7 @@ interface CommentEntity {
|
||||
|
||||
export class CreateCommentDto {
|
||||
@IsString()
|
||||
@Max(5000)
|
||||
@MaxLength(5000)
|
||||
content: string;
|
||||
|
||||
@IsUUID()
|
||||
@@ -47,7 +49,7 @@ export class CreateCommentDto {
|
||||
|
||||
export class UpdateCommentDto {
|
||||
@IsString()
|
||||
@Max(5000)
|
||||
@MaxLength(5000)
|
||||
@IsOptional()
|
||||
content?: string;
|
||||
|
||||
@@ -118,12 +120,14 @@ export class FindCommentsDto {
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@IsOptional()
|
||||
@Type(() => Number)
|
||||
page?: number = 1;
|
||||
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@Max(100)
|
||||
@IsOptional()
|
||||
@Type(() => Number)
|
||||
limit?: number = 20;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user