Skip to content

Commit 8a3d28c

Browse files
committed
refactor: rename and reorganize user DTOs for improved clarity and structure
1 parent 39c0c40 commit 8a3d28c

File tree

4 files changed

+25
-24
lines changed

4 files changed

+25
-24
lines changed
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
import { ApiProperty } from '@nestjs/swagger';
2-
import { IsString, IsNotEmpty } from 'class-validator';
2+
import { IsNotEmpty, IsString } from 'class-validator';
33

44
export class LoginDto {
55
@ApiProperty()
66
@IsString()
77
@IsNotEmpty()
88
public email: string;
9-
10-
@ApiProperty()
11-
@IsString()
12-
@IsNotEmpty()
13-
public password: string;
149
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { ApiProperty } from '@nestjs/swagger';
2+
import { IsNotEmpty, IsString } from 'class-validator';
3+
4+
export class LoginWithEmailDto {
5+
@ApiProperty()
6+
@IsString()
7+
@IsNotEmpty()
8+
public email: string;
9+
}

shared/validation/user/dto/Register.dto.ts renamed to shared/validation/user/dto/NewEmailUser.dto.ts

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
MinLength,
88
} from 'class-validator';
99

10-
export class RegisterDto {
10+
export class NewEmailUserDto {
1111
@ApiProperty({
1212
description: 'User name',
1313
example: 'Tomast1337',
@@ -18,14 +18,6 @@ export class RegisterDto {
1818
@MinLength(4)
1919
username: string;
2020

21-
/*
22-
@ApiProperty()
23-
@IsString()
24-
@IsNotEmpty()
25-
@MaxLength(64)
26-
@MinLength(4)
27-
publicName: string;
28-
*/
2921
@ApiProperty({
3022
description: 'User email',
3123
example: '[email protected]',
@@ -35,13 +27,4 @@ export class RegisterDto {
3527
@MaxLength(64)
3628
@IsEmail()
3729
email: string;
38-
39-
@ApiProperty({
40-
description: 'User password',
41-
example: 'supersecretpassword',
42-
})
43-
@IsString()
44-
@IsNotEmpty()
45-
@MinLength(8)
46-
password: string;
4730
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { ApiProperty } from '@nestjs/swagger';
2+
import { IsNotEmpty, IsString } from 'class-validator';
3+
4+
export class SingleUsePassDto {
5+
@ApiProperty()
6+
@IsString()
7+
@IsNotEmpty()
8+
id: string;
9+
10+
@ApiProperty()
11+
@IsString()
12+
@IsNotEmpty()
13+
pass: string;
14+
}

0 commit comments

Comments
 (0)