-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/LocalMingle/LocalMingle-BE
- Loading branch information
Showing
8 changed files
with
120 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,45 +10,6 @@ import { | |
Matches, | ||
} from 'class-validator'; | ||
|
||
// model User { | ||
// userId Int @id @default(autoincrement()) // Primary Key | ||
// email String @unique | ||
// password String | ||
// createdAt DateTime @default(now()) | ||
// updatedAt DateTime @updatedAt | ||
|
||
// UserDetail UserDetail[] | ||
// HostEvents HostEvent[] | ||
// GuestEvents GuestEvent[] | ||
|
||
// @@map("User") | ||
// } | ||
|
||
/* Eric's code | ||
export class CreateUserDto { | ||
@ApiProperty({ | ||
example: '[email protected]', | ||
description: 'The email of the user', | ||
}) | ||
@IsNotEmpty() | ||
@IsEmail({}, { message: '이메일 형식이 아닙니다.' }) | ||
email: string; | ||
@ApiProperty({ | ||
example: 'Password1!', | ||
description: 'The password of the user', | ||
}) | ||
@IsNotEmpty() | ||
@IsString() | ||
@MinLength(8, { message: '패스워드는 최소 8자리 이상이어야 합니다.' }) | ||
@MaxLength(15, { message: '패스워드는 최대 15자리까지 가능합니다.' }) | ||
@Matches(/^(?=.*[a-zA-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,15}$/, { | ||
message: '패스워드는 8-15 글자, 영문/숫자/특수문자가 포함되어야 합니다.', | ||
}) | ||
password: string; | ||
} | ||
*/ | ||
|
||
export class CreateUserDto { | ||
@IsEmail() | ||
@IsNotEmpty() | ||
|
@@ -58,18 +19,6 @@ export class CreateUserDto { | |
}) | ||
email: string; | ||
|
||
@IsString() | ||
@IsNotEmpty() | ||
@MinLength(8) | ||
@MaxLength(15) | ||
//알파벳 포함 , 숫자 포함 , 특수문자 포함 | ||
@Matches(/^(?=.*[A-Za-z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]+$/) | ||
@ApiProperty({ | ||
description: 'password', | ||
example: 'abc123456789!', | ||
}) | ||
password: string; | ||
|
||
@IsString() | ||
@IsNotEmpty() | ||
@MinLength(2) | ||
|
@@ -89,6 +38,18 @@ export class CreateUserDto { | |
}) | ||
intro: string; | ||
|
||
@IsString() | ||
@IsNotEmpty() | ||
@MinLength(8) | ||
@MaxLength(15) | ||
//알파벳 포함 , 숫자 포함 , 특수문자 포함 | ||
@Matches(/^(?=.*[A-Za-z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]+$/) | ||
@ApiProperty({ | ||
description: 'password', | ||
example: 'abc123456789!', | ||
}) | ||
password: string; | ||
|
||
@IsString() | ||
@IsNotEmpty() | ||
@ApiProperty({ | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,45 @@ | ||
// src/users/dto/update-user.dto.ts | ||
import { PartialType } from '@nestjs/swagger'; | ||
import { ApiProperty, PartialType } from '@nestjs/swagger'; | ||
import { CreateUserDto } from './create-user.dto'; | ||
import { IsNotEmpty, IsString, Matches, MaxLength, MinLength } from 'class-validator'; | ||
|
||
export class UpdateUserDto extends PartialType(CreateUserDto) {} | ||
export class UpdateUserDto { | ||
@IsString() | ||
@IsNotEmpty() | ||
@MinLength(2) | ||
@MaxLength(8) | ||
//영어 또는 한글이 포함 | ||
@Matches(/^(?=.*[A-Za-z가-힣]).*[A-Za-z가-힣0-9]*$/) | ||
@ApiProperty({ | ||
description: 'nickname', | ||
example: '닉네임', | ||
}) | ||
nickname: string; | ||
|
||
@IsString() | ||
@ApiProperty({ | ||
description: 'intro', | ||
example: '안녕하세요', | ||
}) | ||
intro: string; | ||
|
||
@IsString() | ||
@IsNotEmpty() | ||
@MinLength(8) | ||
@MaxLength(15) | ||
//알파벳 포함 , 숫자 포함 , 특수문자 포함 | ||
@Matches(/^(?=.*[A-Za-z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]+$/) | ||
@ApiProperty({ | ||
description: 'password', | ||
example: 'abc123456789!', | ||
}) | ||
password: string; | ||
|
||
@IsString() | ||
@IsNotEmpty() | ||
@ApiProperty({ | ||
description: 'password', | ||
example: 'abc123456789!', | ||
}) | ||
confirmPassword: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters