mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-07-25 09:24:54 +10:00
🚀 release v3.0.0
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { Transform } from 'class-transformer';
|
||||
import { IsEmail, IsNotEmpty, IsString, Matches, MinLength } from 'class-validator';
|
||||
|
||||
export class CreateGoogleUserDto {
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
name: string;
|
||||
|
||||
@MinLength(3)
|
||||
@Transform(({ value }) => (value as string).toLowerCase().replace(/[ ]/gi, '-'))
|
||||
@Matches(/^[a-z0-9-]+$/, {
|
||||
message: 'username can contain only lowercase characters, numbers and hyphens',
|
||||
})
|
||||
username: string;
|
||||
|
||||
@IsEmail()
|
||||
@IsNotEmpty()
|
||||
email: string;
|
||||
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
provider: 'google';
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
import { Transform } from 'class-transformer';
|
||||
import { IsEmail, IsNotEmpty, IsString, Matches, MinLength } from 'class-validator';
|
||||
|
||||
export class CreateUserDto {
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
name: string;
|
||||
|
||||
@MinLength(3)
|
||||
@Transform(({ value }) => (value as string).toLowerCase().replace(/[ ]/gi, '-'))
|
||||
@Matches(/^[a-z0-9-]+$/, {
|
||||
message: 'username can contain only lowercase characters, numbers and hyphens',
|
||||
})
|
||||
username: string;
|
||||
|
||||
@IsEmail()
|
||||
@IsNotEmpty()
|
||||
email: string;
|
||||
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
password: string;
|
||||
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
provider: 'email';
|
||||
|
||||
@IsString()
|
||||
resetToken?: string;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import { PartialType } from '@nestjs/mapped-types';
|
||||
|
||||
import { CreateUserDto } from './create-user.dto';
|
||||
|
||||
export class UpdateUserDto extends PartialType(CreateUserDto) {}
|
||||
Reference in New Issue
Block a user