Skip to content

Commit

Permalink
Merge pull request #104 from DevKor-github/fix/inputlength
Browse files Browse the repository at this point in the history
Fix/inputlength
  • Loading branch information
KimSeongHyeonn authored Oct 5, 2024
2 parents 14587c8 + 3e66601 commit e7d5f19
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/community/comment/dto/create-comment.dto.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsBoolean, IsNotEmpty, IsString } from 'class-validator';
import { IsBoolean, IsNotEmpty, IsString, MaxLength } from 'class-validator';

export class CreateCommentRequestDto {
@IsNotEmpty()
@IsString()
@MaxLength(1000)
@ApiProperty({ description: '댓글 내용' })
content: string;

Expand Down
3 changes: 2 additions & 1 deletion src/community/post/dto/create-post.dto.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { IsNotEmpty, IsString } from 'class-validator';
import { IsNotEmpty, IsString, MaxLength } from 'class-validator';
import { ToBoolean } from 'src/decorators/to-boolean.decorator';

export class CreatePostRequestDto {
@IsNotEmpty()
@IsString()
@MaxLength(255)
@ApiProperty({ description: '게시글 제목' })
title: string;

Expand Down
2 changes: 1 addition & 1 deletion src/entities/comment.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class CommentEntity extends CommonEntity {
@Column({ nullable: true })
parentCommentId: number;

@Column('varchar', { nullable: false })
@Column('varchar', { length: 1000, nullable: false })
content: string;

@Column('boolean', { nullable: false })
Expand Down
3 changes: 2 additions & 1 deletion src/user/dto/create-user-request.dto.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsEmail, IsNotEmpty, IsString } from 'class-validator';
import { IsEmail, IsNotEmpty, IsString, Length } from 'class-validator';

export class CreateUserRequestDto {
@IsNotEmpty()
Expand All @@ -15,6 +15,7 @@ export class CreateUserRequestDto {

@IsNotEmpty()
@IsString()
@Length(5, 10)
@ApiProperty({ description: '중복확인 완료된 userId' })
username: string;

Expand Down
9 changes: 8 additions & 1 deletion src/user/dto/set-profile-request.dto.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsDate, IsNotEmpty, IsOptional, IsString } from 'class-validator';
import {
IsDate,
IsNotEmpty,
IsOptional,
IsString,
Length,
} from 'class-validator';

export class SetProfileRequestDto {
@IsOptional()
@IsString()
@Length(5, 10)
@ApiProperty({ description: '유저아이디' })
username: string;

Expand Down

0 comments on commit e7d5f19

Please sign in to comment.