Skip to content

Commit

Permalink
restrict review minimum length
Browse files Browse the repository at this point in the history
  • Loading branch information
siwonpada committed Jun 25, 2024
1 parent 7f4e3e3 commit 11b8936
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/record/dto/req/createRecordBody.dto.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import { ApiProperty } from '@nestjs/swagger';
import { Recommendation, Semester } from '@prisma/client';
import { IsEnum, IsInt, IsNumber, IsString, Max, Min } from 'class-validator';
import {
IsEnum,
IsInt,
IsNumber,
IsString,
Length,
Max,
Min,
} from 'class-validator';

export class CreateRecordBodyDto {
@ApiProperty({
Expand Down Expand Up @@ -68,6 +76,7 @@ export class CreateRecordBodyDto {
example: '좋아요',
})
@IsString()
@Length(15, 32767)
review: string;

@ApiProperty({
Expand Down
2 changes: 2 additions & 0 deletions src/record/dto/req/updateRecordBoty.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
IsNumber,
IsOptional,
IsString,
Length,
Max,
Min,
} from 'class-validator';
Expand Down Expand Up @@ -90,6 +91,7 @@ export class UpdateRecordBodyDto {
})
@IsString()
@IsOptional()
@Length(15, 32767)
review?: string;

@ApiProperty({
Expand Down

0 comments on commit 11b8936

Please sign in to comment.